parent
de03517b20
commit
a8088c148c
|
@ -10,12 +10,13 @@ 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.cleanupOutputBeforeBuild()
|
Encore
|
||||||
|
.cleanupOutputBeforeBuild()
|
||||||
.setOutputPath('source/build/')
|
.setOutputPath('source/build/')
|
||||||
.setPublicPath('/build')
|
.setPublicPath('/build')
|
||||||
.enableLessLoader()
|
.enableLessLoader()
|
||||||
|
@ -26,19 +27,22 @@ Encore.cleanupOutputBeforeBuild()
|
||||||
path: 'postcss.config.js'
|
path: 'postcss.config.js'
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.enableSourceMaps(!Encore.isProduction());
|
.enableSourceMaps(!Encore.isProduction())
|
||||||
|
;
|
||||||
|
|
||||||
// PurgeCSS
|
// PurgeCSS
|
||||||
// Encore.addPlugin(new PurgecssPlugin({
|
Encore.addPlugin(
|
||||||
// paths: glob.sync([
|
new PurgecssPlugin({
|
||||||
// path.join(__dirname, "source/**/*.{twig,html,md}")
|
paths: glob.sync([
|
||||||
// ]),
|
path.join(__dirname, "source/**/*.{twig,html,md}")
|
||||||
// extractors: [
|
]),
|
||||||
// {
|
extractors: [
|
||||||
// extractor: TailwindExtractor,
|
{
|
||||||
// extensions: ['twig', 'html', 'md']
|
extractor: TailwindExtractor,
|
||||||
// }
|
extensions: ['twig', 'html', 'md']
|
||||||
// ]
|
}
|
||||||
// }));
|
]
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
module.exports = Encore.getWebpackConfig();
|
module.exports = Encore.getWebpackConfig();
|
||||||
|
|
Loading…
Reference in a new issue