|
|
|
@ -79,20 +79,25 @@ const glob = require('glob')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
config.plugins = defaults.plugins.concat([
|
|
|
|
const plugins = [
|
|
|
|
new RemoveEmptyScriptsPlugin(),
|
|
|
|
new RemoveEmptyScriptsPlugin(),
|
|
|
|
new MiniCssExtractPlugin({
|
|
|
|
new MiniCssExtractPlugin({
|
|
|
|
filename: 'css/[name].css',
|
|
|
|
filename: 'css/[name].css',
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
new PurgeCSSPlugin({
|
|
|
|
|
|
|
|
paths: glob.sync(`${defaults.purge.src}/**/*`, { nodir: true }),
|
|
|
|
|
|
|
|
safelist: defaults.purge.safelist
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
new ManifestPlugin({
|
|
|
|
new ManifestPlugin({
|
|
|
|
filename: 'assets-manifest.json',
|
|
|
|
filename: 'assets-manifest.json',
|
|
|
|
context: defaults.destination
|
|
|
|
context: defaults.destination
|
|
|
|
})
|
|
|
|
})
|
|
|
|
])
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (defaults.purge) {
|
|
|
|
|
|
|
|
plugins.push(new PurgeCSSPlugin({
|
|
|
|
|
|
|
|
paths: glob.sync(`${defaults.purge.src}/**/*`, { nodir: true }),
|
|
|
|
|
|
|
|
safelist: defaults.purge.safelist
|
|
|
|
|
|
|
|
}))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.plugins = defaults.plugins.concat(plugins)
|
|
|
|
|
|
|
|
|
|
|
|
// if rules exists add
|
|
|
|
// if rules exists add
|
|
|
|
if (defaults.rules) {
|
|
|
|
if (defaults.rules) {
|
|
|
|
|