webpack 4.x版本
# npm install -g webpack webpack-cli
#webpack --mode development hello.js
生成的文件在dist目录下
# npm install -g webpack webpack-cli
#webpack --mode development hello.js
生成的文件在dist目录下
2018-05-06
webpack4 以后默认 entry 为 src/index.js,默认 output 为 dist/main.js ,不然会报ERROR in Entry module not found: Error: Can't resolve 我就是这样试过
2018-05-01
各位童鞋,大家在执行weibpack hello.js hello.bundle.js命令时,应该会报错吧,因为现在的webpack版本已经到了4.X了,而视频教程用的版本确是3.X,所以会报错,具体解决方案,请看https://blog.csdn.net/u012443286/article/details/79504289
2018-04-30
在module.exports中添加context与不添加context相比,使用context的解析时间会大大缩短
2018-04-27
1.安装了相应插件2.配置文件中设置module:{rules:[ {test:'/\.less$/',use:[{loader:'style-loader'},{loader:'css-loader'}, {loader:'less-loader'} ]}]}3.还是报错,说找不到Loader。ERROR in ./src/style.lessModule parse failed: Unexpected token (1:4)You may need an appropriate loader to handle this file type.
2018-04-27
讲师不必要专职,完全可以兼职,讲师在哪就职、有没有别的收入不重要,只要保证课程进度就可以,这样可以节省建慕课网的成本了。
坚持 改进 坚持 象是在编代码遇到坑一样,要想法摆脱困境,继续向前!!!!!!
坚持 改进 坚持 象是在编代码遇到坑一样,要想法摆脱困境,继续向前!!!!!!
2018-04-26
慕课网做的很好,我很看好这个网站,里面讲师很专业,讲的很系统,很有条理,能及时更新就更好了。
前进的路上一定有困难,但一定要坚持!!!!
前进的路上一定有困难,但一定要坚持!!!!
2018-04-26
报Cannot set property 'innerHTML' of null错误的话, 在webpack.config.js中把inject改成true, 其它的js也可能要相应做一些更改, html渲染是从上到下的, head中的script执行比body要早, getElementById时body中的id=app还没渲染出来, 所以报null
2018-04-25
发现这样插入才行compilation.assets[htmlWebpackPlugin.files.chunks.a.entry.substr(htmlWebpackPlugin.files.publicPath.length).split('?')[0]]._value
注意:
1.去除参数,当htmlWebpackPlugin中配置了hash参数,需去除'?hash值'该段字符串,只剩下相对路径/文件名 relativeStr.split('?')[0] //等同于compilation.assets['js/a.js']
2.source方法报错,直接调用_value读取源码
注意:
1.去除参数,当htmlWebpackPlugin中配置了hash参数,需去除'?hash值'该段字符串,只剩下相对路径/文件名 relativeStr.split('?')[0] //等同于compilation.assets['js/a.js']
2.source方法报错,直接调用_value读取源码
2018-04-18
compilation.assets[htmlWebpackPlugin.files.chunks.a.entry.substr(htmlWebpackPlugin.files.publicPath.length).split('?')[0]]._value
2018-04-18