forked from contao/contao
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
82 lines (73 loc) · 2.85 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
const Encore = require('@symfony/webpack-encore');
const ImageMinimizerPlugin = require('image-minimizer-webpack-plugin');
Encore
.setOutputPath('core-bundle/public/')
.setPublicPath('/bundles/contaocore')
.setManifestKeyPrefix('')
.cleanupOutputBeforeBuild()
.disableSingleRuntimeChunk()
.enableSourceMaps()
.enableVersioning()
.addEntry('backend', './core-bundle/assets/backend.js')
;
const jsConfig = Encore.getWebpackConfig();
Encore.reset();
Encore
.setOutputPath('core-bundle/contao/themes/flexible')
.setPublicPath('/system/themes/flexible')
.setManifestKeyPrefix('')
.cleanupOutputBeforeBuild(['*.css', '*.json', '*.map'])
.disableSingleRuntimeChunk()
.enableSourceMaps()
.enableVersioning()
.configureCssLoader(config => {
config.url = false;
})
.addStyleEntry('backend', './core-bundle/contao/themes/flexible/styles/main.css')
.addStyleEntry('confirm', './core-bundle/contao/themes/flexible/styles/confirm.css')
.addStyleEntry('conflict', './core-bundle/contao/themes/flexible/styles/conflict.css')
.addStyleEntry('diff', './core-bundle/contao/themes/flexible/styles/diff.css')
.addStyleEntry('help', './core-bundle/contao/themes/flexible/styles/help.css')
.addStyleEntry('login', './core-bundle/contao/themes/flexible/styles/login.css')
.addStyleEntry('popup', './core-bundle/contao/themes/flexible/styles/popup.css')
.addStyleEntry('tinymce', './core-bundle/contao/themes/flexible/styles/tinymce.css')
.addStyleEntry('tinymce-dark', './core-bundle/contao/themes/flexible/styles/tinymce-dark.css')
;
const themeConfig = Encore.getWebpackConfig();
Encore.reset();
Encore
.setOutputPath('core-bundle/contao/themes/flexible/icons')
.setPublicPath('/system/themes/flexible/icons')
.setManifestKeyPrefix('')
.disableSingleRuntimeChunk()
.addPlugin(new ImageMinimizerPlugin({
minimizer: {
implementation: ImageMinimizerPlugin.svgoMinify,
options: {
encodeOptions: {
multipass: true,
plugins: [{
name: 'preset-default',
params: {
overrides: {
inlineStyles: {
onlyMatchedOnce: false,
},
convertPathData: {
noSpaceAfterFlags: true,
},
},
},
}],
},
},
},
}))
.copyFiles({
from: './core-bundle/contao/themes/flexible/icons',
to: '[name].[ext]',
pattern: /\.svg$/,
})
;
const iconConfig = Encore.getWebpackConfig();
module.exports = [jsConfig, themeConfig, iconConfig];