求解!??!打包的時候報錯了
webpack hello.js hello.bundle.js
Hash: c5b40cd56e56d95d3f6b
Version: webpack 1.15.0
Time: 41ms
? ?[0] ./hello.js 0 bytes [built] [failed]
ERROR in ./hello.js
Module parse failed: F:\webpack\webpack-test\hello.js Unexpected token (1:9)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (1:9)
2018-09-16
webpack hello.js? -o bundle.hello.js --mode=production
2018-09-15
webpack app.js -o? holle.js --mode=production
2018-08-13
看了下評論 試了提供的各種方法任然報錯? ?之后網上搜索需要全局安裝,反正把所有的步驟執(zhí)行一遍,問題就解決了 步驟
npm init
npm install webpack@1.13.2 --save-dev
npm install webpack -g
webpack hello.js -o ./hello.bundle.js --mode development
2018-08-13
在按照本課程學習webpack之前,得先確定你和老師所用的webpack的版本差異,現在直接運行npm i webpack -D 后的webpack版本是4.16.5(2018年8月13日),而這個課程的發(fā)布時間應該較早,我沒有細看該課,很有可能是webpack 3.x 版本,所以導致報錯