非全局安裝執(zhí)行node_module/.bin/webpack hello.js hello.bundle.js.
http://www.jianshu.com/p/42e11515c10f
http://www.jianshu.com/p/42e11515c10f
2017-02-23
感謝老師的教學(xué),課程很實(shí)用,從最簡單的配置開始,一步一步加深,理解起來特別容易!?。∽罱居行枨笠玫絯ebpack,正好看到有這個(gè)課程,哈哈哈,贊!
2017-02-23
找到原因了,--module-bind 后面的字符串如果是單引號會(huì)出錯(cuò),但是換成雙引號就可以了。
運(yùn)行:webpack hello.js hello.bundle.js --module-bind "css=style-loader!css-loader"
顯示ok的。
運(yùn)行:webpack hello.js hello.bundle.js --module-bind "css=style-loader!css-loader"
顯示ok的。
2017-02-23
<% for(var key in htmlWebpackPlugin.files.chunks){ %>
<% if(key !== 'main'){ %>
<script type="text/javascript" src="<%= htmlWebpackPlugin.files.chunks[key].entry %>"></script>
<% } %>
<% } %>
<% if(key !== 'main'){ %>
<script type="text/javascript" src="<%= htmlWebpackPlugin.files.chunks[key].entry %>"></script>
<% } %>
<% } %>
2017-02-23
<script type="text/javascript">
<%= compilation.assets[htmlWebpackPlugin.files.chunks.main.entry.substr(htmlWebpackPlugin.files.publicPath.length)].source() %>
</script>
<%= compilation.assets[htmlWebpackPlugin.files.chunks.main.entry.substr(htmlWebpackPlugin.files.publicPath.length)].source() %>
</script>
2017-02-23
ERROR in ./style.css
Module parse failed: F:\webpack\style.css Unexpected token (1:9)
You may need an appropriate loader to handle this file type.
運(yùn)行webpack hello.js hello.bundle.js --module-bind 'css=style-loader!css-loader' 報(bào)的錯(cuò)
Module parse failed: F:\webpack\style.css Unexpected token (1:9)
You may need an appropriate loader to handle this file type.
運(yùn)行webpack hello.js hello.bundle.js --module-bind 'css=style-loader!css-loader' 報(bào)的錯(cuò)
2017-02-23
<%= htmlWebpackPlugin.files.chunks.main.entry.substr([htmlWebpackPlugin.files.publicPath.length]) %>
2017-02-23
視頻中的webpack版本是1.xx了, 現(xiàn)在通過npm下載的webpack已經(jīng)是2.xx,所以咯,大家看視頻教程練習(xí)的時(shí)候一定要認(rèn)清版本。
2017-02-23
"webpack": "webpack --config webpack.config.js --progress --display-modules --colors --display-reasons"
npm run webpack 即可
npm run webpack 即可
2017-02-23