Use Mix and sass, simplify image directories and remove duplicates
This commit is contained in:
parent
ad3bc4b0a2
commit
ff29fdeb71
216 changed files with 2921 additions and 1096 deletions
|
@ -1,45 +0,0 @@
|
|||
var Encore = require('@symfony/webpack-encore');
|
||||
var glob = require('glob-all');
|
||||
var path = require('path');
|
||||
var CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
var PurgecssPlugin = require('purgecss-webpack-plugin');
|
||||
|
||||
class TailwindExtractor {
|
||||
static extract(content) {
|
||||
return content.match(/[A-z0-9-:\/]+/g);
|
||||
}
|
||||
}
|
||||
|
||||
Encore.cleanupOutputBeforeBuild()
|
||||
.setOutputPath('source/build/')
|
||||
.setPublicPath('/build')
|
||||
.enableLessLoader()
|
||||
.addEntry('js/site', './assets/js/main.js')
|
||||
.addStyleEntry('css/site', './assets/less/main.less')
|
||||
.enablePostCssLoader(function(options) {
|
||||
options.config = {
|
||||
path: 'postcss.config.js'
|
||||
};
|
||||
})
|
||||
.enableSourceMaps(!Encore.isProduction())
|
||||
.addPlugin(new CopyWebpackPlugin([
|
||||
{ from: './assets/static', to: 'static' }
|
||||
]));
|
||||
|
||||
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();
|
Loading…
Add table
Add a link
Reference in a new issue