2
我試圖運行NPM運行建立,但我不能這樣做。
,我使用的WebPack 2,但它給我的uglifyJs的ERROR
從UglifyJs 意外標記
app.3e1e32973e47000acf37.js:關鍵字(功能)[app.3e1e32973e47000acf37.js:130155,20] 在應用程序錯誤從UglifyJs
的WebPack醜化錯誤:意外的令牌:關鍵字(功能)
這裏.bundle.js是我的package.json
"devDependencies": {
"angular-animate": "^1.6.4",
"angular-aria": "^1.6.4",
"angular-sanitize": "^1.6.4",
"babel-core": "^6.2.1",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"copy-webpack-plugin": "4.0.1",
"html-webpack-plugin": "^2.7.1",
"postcss-loader": "1.2.2",
"raw-loader": "^0.5.1",
"rimraf": "^2.5.1",
"style-loader": "^0.13.0",
"webpack": "2.2.0",
"webpack-dev-server": "2.2.0"
}
"scripts": {
"build": "rimraf dist && webpack -p --bail --progress --profile",
"server": "webpack-dev-server --port 8080 --history-api-fallback --inline --progress",
"start": "npm run server"
},
這裏是我的webpack.config.js文件
config.module = {
rules: [{
// JS LOADER
// Reference: https://github.com/babel/babel-loader
// Transpile .js files using babel-loader
// Compiles ES6 and ES7 into ES5 code
test: /\.js$/,
loader: 'babel-loader',**strong text**
exclude: /node_modules/
}
這裏是我的巴貝爾文件
{
"presets": ["es2015"]
}
當我與這個新的測試對象改變webpack.config.js文件從JS到ES6
config.module = {
rules: [{
// JS LOADER
// Reference: https://github.com/babel/babel-loader
// Transpile .js files using babel-loader
// Compiles ES6 and ES7 into ES5 code
test: /\.es6$/,
loader: 'babel-loader',**strong text**
exclude: /node_modules/
}
我從UglifyJs得到app.8c6dc5e29db45e3eb325.js的錯誤 ERROR意外標記:運算符(>)[app.8c6dc5e29db45e3eb325.js:5564,32]
請讓我知道我在做什麼錯在這裏運行NPM運行建立?