使用字板并尝试使用laravel-mix编译我的js文件,我在控制台中遇到意外的令牌错误 mix
我的配置
package.json
W/RenderThread: type=1400 audit(0.0:631436): avc: denied { read } for name="perf_ioctl" dev="proc" ino=4026533695 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:proc:s0 tclass=file permissive=0
我的webpack.mix.js
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"dependencies": {
"bulma": "^0.7.1",
"cross-env": "^5.1.6",
"dotenv": "^6.0.0",
"jquery": "^3.3.1",
"laravel-mix": "^2.1.11",
"underscore": "^1.9.1",
"vue": "^2.5.16",
"vue-resource": "^1.5.1",
"vue-router": "^3.0.1"
},
"browserslist": [
">0.25%",
"not ie 11",
"not op_mini all"
],
"devDependencies": {
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2016": "^6.24.1",
"babel-preset-stage-2": "^6.24.1"
}
}
.babelrc
const mix = require('laravel-mix');
require('dotenv').config();
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for your application, as well as bundling up your JS files.
|
*/
const theme = process.env.WP_THEME;
mix.setResourceRoot('../');
mix.setPublicPath(`public/themes/${theme}/assets`);
mix.js('resources/assets/scripts/site.js', 'scripts');
mix.sass('resources/assets/styles/site.scss', 'styles');
mix.version();
site.js
{
"presets": [
["es2016"]
],
"plugins": [
"babel-plugin-transform-class-properties",
"syntax-dynamic-import"
]
}
为什么此设置失败?