非全局安裝執行node_module/.bin/webpack hello.js hello.bundle.js.
http://www.jianshu.com/p/42e11515c10f
http://www.jianshu.com/p/42e11515c10f
2017-02-23
感謝老師的教學,課程很實用,從最簡單的配置開始,一步一步加深,理解起來特別容易?。?!最近公司有需求要用到webpack,正好看到有這個課程,哈哈哈,贊!
2017-02-23
找到原因了,--module-bind 后面的字符串如果是單引號會出錯,但是換成雙引號就可以了。
運行:webpack hello.js hello.bundle.js --module-bind "css=style-loader!css-loader"
顯示ok的。
運行: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.
運行webpack hello.js hello.bundle.js --module-bind 'css=style-loader!css-loader' 報的錯
Module parse failed: F:\webpack\style.css Unexpected token (1:9)
You may need an appropriate loader to handle this file type.
運行webpack hello.js hello.bundle.js --module-bind 'css=style-loader!css-loader' 報的錯
2017-02-23
<%= htmlWebpackPlugin.files.chunks.main.entry.substr([htmlWebpackPlugin.files.publicPath.length]) %>
2017-02-23
視頻中的webpack版本是1.xx了, 現在通過npm下載的webpack已經是2.xx,所以咯,大家看視頻教程練習的時候一定要認清版本。
2017-02-23
"webpack": "webpack --config webpack.config.js --progress --display-modules --colors --display-reasons"
npm run webpack 即可
npm run webpack 即可
2017-02-23