想要新添加的.html文件生效得改
build/webpack.dev.conf.js
文件的
plugins
部分
module.exports = merge(baseWebpackConfig, {
module: {
loaders: utils.styleLoaders()
},
// eval-source-map is faster for development devtool: '#eval-source-map', plugins: [ // https://github.com/glenjamin/webpack-hot-middleware#installation--usage new webpack.optimize.OccurenceOrderPlugin(), new webpack.HotModuleReplacementPlugin(), new webpack.NoErrorsPlugin(), // https://github.com/ampedandwired/html-webpack-plugin new HtmlWebpackPlugin({ filename: 'index.html', template: 'index.html', inject: true }), new HtmlWebpackPlugin({ filename: '另一个.html', template: '另一个模板.html', inject: true }) ] })