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

21 lines
598 B
JavaScript
Raw Normal View History

2020-03-16 00:21:07 +00:00
let Encore = require('@symfony/webpack-encore')
let purgecssConfig = require('./purgecss.config')
let PurgecssPlugin = require('purgecss-webpack-plugin')
2020-03-16 00:21:07 +00:00
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))
}
2020-03-16 00:21:07 +00:00
module.exports = Encore.getWebpackConfig()