Run Purgecss only for production

Fixes #52
This commit is contained in:
Oliver Davies 2018-01-31 01:12:34 +00:00
parent 8f5163e6bf
commit 5c3225c33c

View file

@ -27,18 +27,20 @@ Encore.cleanupOutputBeforeBuild()
})
.enableSourceMaps(!Encore.isProduction());
Encore.addPlugin(
new PurgecssPlugin({
paths: glob.sync([
path.join(__dirname, "output_*/**/*.html"),
]),
extractors: [
{
extractor: TailwindExtractor,
extensions: ['twig', 'html', 'md']
}
]
})
);
if (Encore.isProduction()) {
Encore.addPlugin(
new PurgecssPlugin({
paths: glob.sync([
path.join(__dirname, "output_*/**/*.html"),
]),
extractors: [
{
extractor: TailwindExtractor,
extensions: ['twig', 'html', 'md']
}
]
})
);
}
module.exports = Encore.getWebpackConfig();