求解?。?!打包的時(shí)候報(bào)錯(cuò)了
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
看了下評(píng)論 試了提供的各種方法任然報(bào)錯(cuò)? ?之后網(wǎng)上搜索需要全局安裝,反正把所有的步驟執(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
在按照本課程學(xué)習(xí)webpack之前,得先確定你和老師所用的webpack的版本差異,現(xiàn)在直接運(yùn)行npm i webpack -D 后的webpack版本是4.16.5(2018年8月13日),而這個(gè)課程的發(fā)布時(shí)間應(yīng)該較早,我沒有細(xì)看該課,很有可能是webpack 3.x 版本,所以導(dǎo)致報(bào)錯(cuò)