-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
webpack.config.js
51 lines (42 loc) · 1.24 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
43
44
45
46
47
48
49
50
51
/*!
* This file is part of the Sonata Project package.
*
* (c) Thomas Rabaix <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
const Encore = require('@symfony/webpack-encore');
const StyleLintPlugin = require('stylelint-webpack-plugin');
Encore.setOutputPath('./src/Bridge/Symfony/Resources/public')
.setPublicPath('/bundles/sonataform')
.setManifestKeyPrefix('bundles/sonataform')
.cleanupOutputBeforeBuild()
.enableSassLoader()
.enablePostCssLoader()
.enableVersioning(false)
.enableSourceMaps(false)
.enableEslintPlugin()
.disableSingleRuntimeChunk()
.addExternals({
'@hotwired/stimulus': 'stimulus',
})
.configureCssMinimizerPlugin((options) => {
options.minimizerOptions = {
preset: ['default', { discardComments: { removeAll: true } }],
};
})
.addPlugin(
new StyleLintPlugin({
context: 'assets/scss',
emitWarning: true,
})
)
.configureTerserPlugin((options) => {
options.terserOptions = {
output: { comments: false },
};
options.extractComments = false;
})
.addEntry('app', './assets/js/app.js');
module.exports = Encore.getWebpackConfig();