$ webpack ./src/page/index.js ./dist/app.jsC:\Users\iuyiy\desktop\mall\webpack.config.js:2 entry: './src/page/index/index.js', ^SyntaxError: Invalid or unexpected token at NativeCompileCache._moduleCompile (C:\Users\iuyiy\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\ v8-compile-cache\v8-compile-cache.js:226:18) at Module._compile (C:\Users\iuyiy\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\v8-compile-cache\v 8-compile-cache.js:172:36) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17) at require (C:\Users\iuyiy\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\v8-compile-cache\v8-compil e-cache.js:159:20) at WEBPACK_OPTIONS (C:\Users\iuyiy\AppData\Roaming\npm\node_modules\webpack-cli\bin\convert-argv.js:133:13) at requireConfig (C:\Users\iuyiy\AppData\Roaming\npm\node_modules\webpack-cli\bin\convert-argv.js:135:6) at C:\Users\iuyiy\AppData\Roaming\npm\node_modules\webpack-cli\bin\convert-argv.js:142:17 at Array.forEach (<anonymous>) at module.exports (C:\Users\iuyiy\AppData\Roaming\npm\node_modules\webpack-cli\bin\convert-argv.js:140:15) at yargs.parse (C:\Users\iuyiy\AppData\Roaming\npm\node_modules\webpack-cli\bin\webpack.js:239:39) at Object.parse (C:\Users\iuyiy\AppData\Roaming\npm\node_modules\webpack-cli\node_modules\yargs\yargs.js:543:18 ) at C:\Users\iuyiy\AppData\Roaming\npm\node_modules\webpack-cli\bin\webpack.js:217:8 at Object.<anonymous> (C:\Users\iuyiy\AppData\Roaming\npm\node_modules\webpack-cli\bin\webpack.js:512:3) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object.<anonymous> (C:\Users\iuyiy\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js:12:2) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3)
3 回答
lily001
TA贡献1条经验 获得超1个赞
注意: - 输出需要明确指定。所以改为--webpack ./src/page/index/index.js --output ./dist/app.js --mode development
慕运维5913954
TA贡献1条经验 获得超0个赞
我刚刚也遇到了这个问题,应该是webpack版本太高了,1.15.0版本用webpack ./src/page/index.js ./dist/app.js这个命令就可以,4.17.1版本就不行了,就需要用楼上说的webpack ./src/page/index/index.js --output ./dist/app.js --mode development
- 3 回答
- 0 关注
- 3605 浏览
添加回答
举报
0/150
提交
取消