首页 新闻 会员 周边

vue通过执行npm run build打包出来的dist文件夹中没有index.html

0
[已解决问题] 解决于 2018-04-25 10:24

利用vue init webpack-simple+项目名称 搭建的vue项目结构,为什么在执行完npm run build之后生成的dist文件夹中只有build.js和buiid.js.map两个文件,怎么没有index.html,这样打包后怎么在浏览器中打开打包后的页面?

~逍遥★星辰~的主页 ~逍遥★星辰~ | 菜鸟二级 | 园豆:245
提问于:2018-03-31 15:43
< >
分享
最佳答案
-1

1.  webpack的配置文件中有个配置项:

new HtmlWebpackPlugin({
favicon: 'favicon.ico',
filename: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
 
看看你是不是配置不太对?
 
2. 看看你自己有没有index.html
奖励园豆:5
thisis阿志啊 | 菜鸟二级 |园豆:327 | 2018-04-02 11:19
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册