随着配置的WebPack巴贝尔装载机用 '0级' 和 'ES2015' 预设不承认import语句
module.exports = { context: __dirname + "/src", entry: "./main", output: { path: __dirname + "/dist", filename: "bundle.js" }, loaders: [ { test: /\.jsx?$/, exclude: /(node_modules|bower_components)/, loader: 'babel', // 'babel-loader' is also a legal name to reference query: { plugins: ['transform-runtime'], presets: ['react', 'stage-0', 'es2015'] } } ] }
(试图删除0级也)
我有Line 8: Unexpected token ... You may need an appropriate loader to handle this file type.
错误的src/main.js其中线8是注释后第一行:
/*! @preserve * * The MIT License (MIT) * * * */ import t from './'
P重置已安装,node_modules中的webpack版本为1.12.11
。
“意外令牌......”?这是“...”是错误信息的实际部分,还是只是切断了其中的一部分? – Kreozot
我只是把它关掉了。 –