-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathwebpack.config.js
42 lines (37 loc) · 1.15 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const Encore = require('@symfony/webpack-encore');
const tailwindcss = require('tailwindcss');
const autoprefixer = require('autoprefixer');
const path = require('path');
const purgecss = require('@fullhuman/postcss-purgecss')({
content: [
'./templates/**/*.twig',
'./assets/js/**/*.vue',
'./assets/js/**/*.js',
],
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [],
});
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.addEntry('app', './assets/app.js')
.enableSingleRuntimeChunk()
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.enableSassLoader(sassOptions => {
}, {
resolveUrlLoader: false
})
.enablePostCssLoader(options => {
options.postcssOptions = {
// directory where the postcss.config.js file is stored
config: path.resolve(__dirname, 'postcss.config.js'),
pluginsplugins: [
tailwindcss,
autoprefixer,
]
};
})
.enableVueLoader()
;
module.exports = Encore.getWebpackConfig();