Tidy webpack config
This commit is contained in:
parent
6312dc507d
commit
ad64d11ec0
|
@ -1,5 +1,4 @@
|
||||||
var Encore = require('@symfony/webpack-encore');
|
var Encore = require('@symfony/webpack-encore');
|
||||||
var tailwindcss = require('tailwindcss');
|
|
||||||
var glob = require('glob-all');
|
var glob = require('glob-all');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var PurgecssPlugin = require('purgecss-webpack-plugin');
|
var PurgecssPlugin = require('purgecss-webpack-plugin');
|
||||||
|
@ -10,13 +9,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,10 +25,8 @@ Encore
|
||||||
path: 'postcss.config.js'
|
path: 'postcss.config.js'
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.enableSourceMaps(!Encore.isProduction())
|
.enableSourceMaps(!Encore.isProduction());
|
||||||
;
|
|
||||||
|
|
||||||
// PurgeCSS
|
|
||||||
Encore.addPlugin(
|
Encore.addPlugin(
|
||||||
new PurgecssPlugin({
|
new PurgecssPlugin({
|
||||||
paths: glob.sync([
|
paths: glob.sync([
|
||||||
|
|
Loading…
Reference in a new issue