你能帮我在 laravel-mix-pug 之后的一行中的 html 缩小代码吗?
我的代码现在不起作用,我不知道是什么原因:
let mix = require('laravel-mix');
mix.pug = require('laravel-mix-pug');
let pretty = true;
if (mix.inProduction()) pretty = false;
mix.js(['src/js/main.js', 'src/js/plugins.js'], 'dist/js/scripts.js')
.sass('src/sass/app.scss', 'dist/css/styles.css')
.options({
processCssUrls: false
})
.pug('src/*.pug', '../dist', {
pug: {
pretty: pretty
}
});
mix.webpackConfig({
module: {
rules: [
{
test: /\.html$/,
loader: 'html-loader',
options: {
minimize: {
removeComments: true,
collapseWhitespace: true,
minifyJS: true
},
},
},
],
},
});