Disable PurgeCSS for now

Issue #48
This commit is contained in:
Oliver Davies 2018-01-30 18:01:10 +00:00
parent 78326d6fd5
commit 73a7a80a33

View file

@ -10,13 +10,12 @@ var PurgecssPlugin = require('purgecss-webpack-plugin');
* https://github.com/FullHuman/purgecss-webpack-plugin * https://github.com/FullHuman/purgecss-webpack-plugin
*/ */
class TailwindExtractor { class TailwindExtractor {
static extract(content) { static extract(content) {
return content.match(/[A-z0-9-:\/]+/g); return content.match(/[A-z0-9-:\/]+/g);
} }
} }
Encore Encore.cleanupOutputBeforeBuild()
.cleanupOutputBeforeBuild()
.setOutputPath('source/build/') .setOutputPath('source/build/')
.setPublicPath('/build') .setPublicPath('/build')
.enableLessLoader() .enableLessLoader()
@ -27,22 +26,19 @@ Encore
path: 'postcss.config.js' path: 'postcss.config.js'
}; };
}) })
.enableSourceMaps(!Encore.isProduction()) .enableSourceMaps(!Encore.isProduction());
;
// PurgeCSS // PurgeCSS
Encore.addPlugin( // Encore.addPlugin(new PurgecssPlugin({
new PurgecssPlugin({ // paths: glob.sync([
paths: glob.sync([ // path.join(__dirname, "source/**/*.{twig,html,md}")
path.join(__dirname, "source/**/*.{twig,html,md}") // ]),
]), // extractors: [
extractors: [ // {
{ // extractor: TailwindExtractor,
extractor: TailwindExtractor, // extensions: ['twig', 'html', 'md']
extensions: ['twig', 'html', 'md'] // }
} // ]
] // }));
})
);
module.exports = Encore.getWebpackConfig(); module.exports = Encore.getWebpackConfig();