我在 Visual Studio Code 1.4.0 中运行 .js 文件
但是当我这样做时
var test = state.selectedStorage.storageItems.map(i => {
if(i.id != action.payload) return i;
return {
...i,
qty: i.qty - 1
}
});
我在 3 个点下划了一条下划线(预期的属性分配)。当我尝试做一个npm start
我得到
Unexpected token (134:18)
这是我的 webpack.config.js
module.exports = {
devtool: 'inline-source-map',
entry: "./app/index.js",
output: {
path: __dirname + '/dist',
filename: "bundle.js"
},
devServer: {
contentBase: "./app",
inline: true,
port: 3333
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015', 'react']
}
},
{
test: /\.scss$/,
loaders: ['style', 'css', 'sass']
},
{
test: /\.woff($|\?)|\.woff2($|\?)|\.ttf($|\?)|\.eot($|\?)|\.svg($|\?)/,
loader: 'url-loader'
}
]
},
externals: {
jquery: 'jQuery'
},
}