YMFE / ykit

基于 Webpack 的灵活快速的打包工具,帮助稳定高效构建现代 JavaScript 应用。
https://ykit.ymfe.org/
Apache License 2.0
392 stars 55 forks source link

prd 目录没有 index.html? #12

Closed ywzhaiqi closed 6 years ago

ywzhaiqi commented 7 years ago

执行 ykit pack -m 命令后,prd 目录没有 index.html

尝试添加 html-webpack-plugin,结果错误:

Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin'

如果要给每个文件加上 hash,该怎么做?

yuhaoju commented 7 years ago

给文件加上 hash 可以在 ykit.js 的 modifyWebpackConfig 中:

baseConfig.output.prd.filename ='[name]@[chunkhash][ext]';

关于 html-webpack-plugin,目前发现有兼容性问题,目前如果需求是把带有 hash 的资源名打入 index.html 并生成在 prd 我可以看下这块怎么处理