1
是否可以使用html-webpack-plugin在头部和部分内容中编写一些块?Webpack - html-webpack-plugin - 一个文件名 - 多注入
这是我的HTML的WebPack-插件配置:
var HtmlWebpackPluginConfigIndex = {
template: path.join(__dirname, 'src/core/server/views', 'index.dust'),
filename: 'core/server/views/index.dust',
hash: true,
chunksSortMode: 'none'
// chunks: ['core/public/js/vendor']
};
当我使用复制与此配置,但与改变大块:
var HtmlWebpackPluginConfigIndex = {
template: path.join(__dirname, 'src/core/server/views', 'index.dust'),
filename: 'core/server/views/index.dust',
hash: true,
inject: 'head',
chunksSortMode: 'none'
chunks: ['core/public/js/vendor']
};
var HtmlWebpackPluginConfigIndex2 = {
template: path.join(__dirname, 'src/core/server/views', 'index.dust'),
filename: 'core/server/views/index.dust',
hash: true,
inject: 'body',
chunksSortMode: 'none'
chunks: ['core/public/js/app']
};
....
new HtmlWebpackPlugin(HtmlWebpackPluginConfigIndex);
new HtmlWebpackPlugin(HtmlWebpackPluginConfigIndex2);
的WebPack仅去年申请大块的HTML -webpack的插件。