pug-plugin
Advanced tools
Changelog
4.1.0 (2022-08-03)
filename
property to the pathData
argument of the filename(pathData)
function in entry objectChangelog
4.0.0 (2022-08-03)
PugPlugin.loader.option.method
is now render
instead of compile
,
because it makes sense in the vast majority of use cases.method
option:{
loader: PugPlugin.loader,
options: {
method: 'compile', // now the default method is `render`
}
},
outputFile
property of the ResourceInfo (the argument of postprocess
function) was replaced with outputPath
.postprocess
was used the outputFile
),
add in your postprocess function the code line:new PugPlugin({
postprocess: (content, info) => {
const outputFile = path.join(info.outputPath, info.assetFile); // add this line to get the removed outputFile
// ...
return content;
}
}),
render
and compile
methodsChangelog
3.1.3 (2022-07-23)
Changelog
3.1.2 (2022-07-23)
Changelog
3.1.1 (2022-07-21)
Changelog
3.1.0 (2022-07-19) DEPRECATED, use v3.1.1
extractComments
option to enable/disable saving comments in *.LICENSE.txt fileChangelog
3.0.0 (2022-07-17)
Drop support for Node 12
, minimum supported version is 14.18
sass-loader
13.x requires Node 14.By default, the embedded CSS extractor module is now enabled. For compatibility with external extractor, you can disable extractCss module:
new PugPlugin({
extractCss: {
enabled: false, // disable embedded extractCss module to bypass extracting via external plugin
},
}),
definition of extractCss as plugin module is deprecated:
new PugPlugin({
modules: [
PugPlugin.extractCss({
filename: 'assets/css/[name].[contenthash].css',
})
],
}),
now use the new extractCss
option:
new PugPlugin({
extractCss: {
filename: 'assets/css/[name].[contenthash].css',
},
}),
Note: you can still use the
modules: []
option for custom settings.
publicPath
extractCss
option for embedded CSS extract moduleextractCss
module is enabled with default optionsnew PugPlugin()
is equivalent to:
new PugPlugin({
test: /\.(pug)$/,
enabled: true,
verbose: false,
pretty: false,
sourcePath: null,
outputPath: null,
filename: '[name].html',
extractComments: false,
extractCss: {
test: /\.(css|scss|sass|less|styl)$/,
enabled: true,
verbose: false,
filename: '[name].css',
sourcePath: null,
outputPath: null,
},
modules: [],
}),
publicPath