forked from sonata-project/SonataPageBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
53 lines (44 loc) · 1.27 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
52
53
/*!
* 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/Resources/public')
.setPublicPath('.')
.setManifestKeyPrefix('bundles/sonatapage')
.cleanupOutputBeforeBuild()
.enableSassLoader()
.enablePostCssLoader()
.enableVersioning(false)
.enableSourceMaps(false)
.enableEslintPlugin()
.autoProvidejQuery()
.disableSingleRuntimeChunk()
.addExternals({
jquery: 'jQuery',
})
.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;
})
.addStyleEntry('frontend', './assets/scss/frontend.scss')
.addEntry('app', './assets/js/app.js');
module.exports = Encore.getWebpackConfig();