laravel-mix: Error on commands dev and production
Hello π
If i run commands by npm run dev or npm run production, then after some seconds i see this error in console:
ERROR Failed to compile with 1 errors
error
/js/app.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [./~/bootstrap/js/src/util.js:8,0][/js/app.js:81,19]
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 28 (10 by maintainers)
@opmind Iβd been using that solution:
"uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony"but now it doesnβt works for me. I found another solution:"uglify-js": "git://github.com/mishoo/UglifyJS2#harmony-v2.8.22"and thennpm ioryarn installI have solved same problem with import js files from src using #harmony version of ugifyjs: package.json:
"uglify-js": "git+https://github.com/mishoo/UglifyJS2.git#harmony"and thennpm ioryarn installand resolving node_modules folder with bootstrap in babel-loader section of webpack.config. https://stackoverflow.com/a/43893311@CasperLaiTW Yea, same problems, thanks π
@rorc I think you have to require dist folder
src files is ES6 code. and config exclude
node_modulesso webpack donβt compile it.