Js compress by uglify-js give error Unexpected token: name ($)
问题 I am compress my js files by uglify-js I want to compress Bootstrap 4 js file but it give me Error like this. Can I compress all js files by only uglify-js Or how can i do it. Parse error at src\bootstrap\alert.js:1,7 import $ from 'jquery' ^ ERROR: Unexpected token: name ($) my package.json "devDependencies": { "node-sass": "^4.6.1", "nodemon": "^1.12.1" }, "dependencies": { "autoprefixer": "^7.1.6", "jquery": "^3.2.1", "postcss-cli": "^4.1.1", "uglify-js": "^3.1.9" } 回答1: Try using the ES6