我已阅读part of the Webpack documentation,它解释了为什么在使用module.loaders
语法设置加载程序时,Webpack将缩小HTML的大小。但是我找不到解释如何阻止这一点的任何地方。我正在使用pug-loader
和html-webpack-plugin
来处理我的模板,但是Webpack总是将它们与HTML缩小混在一起。如何停止Webpack缩小HTML?
我该如何解决这个问题?
{
test: /\.pug$/,
use: 'pug-loader'
}
new HtmlWebpackPlugin({
title: 'Home',
filename: 'index.html',
template: './src/index.pug',
inject: 'head',
chunks: ['app'],
hash: true
}),
这是使用'pug-html-loader'插件。 –
虽然这个选项也适用于'pug-loader'并且可以工作,所以谢谢! –