This repository has been archived on 2025-01-07. You can view files and clone it, but cannot push or open issues or pull requests.
rebuilding-bartik/webpack.config.js
2020-03-16 09:34:53 +00:00

21 lines
598 B
JavaScript

let Encore = require('@symfony/webpack-encore')
let purgecssConfig = require('./purgecss.config')
let PurgecssPlugin = require('purgecss-webpack-plugin')
Encore
.disableSingleRuntimeChunk()
.cleanupOutputBeforeBuild()
.setOutputPath('public/build/')
.setPublicPath('/build')
.addEntry('app', './assets/js/app.js')
.enablePostCssLoader()
.configureLoaderRule('css', loaderRule => {
loaderRule.test = /\.(css|p(ost)?css)$/
})
if (Encore.isProduction()) {
Encore.addPlugin(new PurgecssPlugin(purgecssConfig))
}
module.exports = Encore.getWebpackConfig()