-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
39 lines (36 loc) · 987 Bytes
/
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
const Encore = require('@symfony/webpack-encore');
const WebpackCleanupPlugin = require('webpack-cleanup-plugin');
Encore
.enableSingleRuntimeChunk()
.setOutputPath('public/dist/')
.setPublicPath('/dist')
.addEntry('app', ['./assets/js/main.js'])
.addStyleEntry('style', './assets/scss/style.scss')
// .enableReactPreset()
.enableVersioning()
.configureFilenames({
css: 'css/[name].[contenthash].css',
js: 'js/[name].[contenthash].js',
images: 'images/[name].[hash:8].[ext]'
})
.enableSassLoader()
.enableSourceMaps(!Encore.isProduction())
.addPlugin(new WebpackCleanupPlugin(
{
output: {
preview: true,
path: "public/dist"
}
}
));
if (Encore.isProduction()) {
Encore
.addPlugin(new OptimizeCssAssetsPlugin({
cssProcessorOptions: {
discardComments: {
removeAll: true
}
}
}))
};
module.exports = Encore.getWebpackConfig();