Replace Mix with Encore
This commit is contained in:
parent
95450f2719
commit
5c8daf3054
25 changed files with 1352 additions and 3844 deletions
25
webpack.config.js
Normal file
25
webpack.config.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
const Encore = require('@symfony/webpack-encore')
|
||||
const glob = require('glob-all')
|
||||
const PurgecssPlugin = require('purgecss-webpack-plugin')
|
||||
|
||||
Encore
|
||||
.disableSingleRuntimeChunk()
|
||||
.cleanupOutputBeforeBuild()
|
||||
.setOutputPath('source/build/')
|
||||
.setPublicPath('/build')
|
||||
.addEntry('app', './assets/js/app.js')
|
||||
.enablePostCssLoader()
|
||||
.enableVueLoader()
|
||||
.enableSourceMaps(!Encore.isProduction())
|
||||
|
||||
if (Encore.isProduction()) {
|
||||
Encore.addPlugin(new PurgecssPlugin({
|
||||
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [],
|
||||
paths: () => glob.sync([
|
||||
'assets/**/*.vue',
|
||||
'source/**/*.{md,twig}'
|
||||
])
|
||||
}))
|
||||
}
|
||||
|
||||
module.exports = Encore.getWebpackConfig()
|
Loading…
Add table
Add a link
Reference in a new issue