-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
46 lines (38 loc) · 1.34 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
const Encore = require('@symfony/webpack-encore');
const path = require('path');
const getEzConfig = require('./ez.webpack.config.js');
const eZConfigManager = require('./ez.webpack.config.manager.js');
const eZConfig = getEzConfig(Encore);
const customConfigs = require('./ez.webpack.custom.configs.js');
Encore.reset();
Encore
.setOutputPath('public/build/')
.setPublicPath('/build')
.enableStimulusBridge('./assets/controllers.json')
.enableSassLoader()
.enableReactPreset()
.enableSingleRuntimeChunk()
.copyFiles({
from: './assets/images',
to: 'images/[path][name].[ext]',
pattern: /\.(png|svg)$/
})
.configureBabel((config) => {
config.plugins.push('@babel/plugin-proposal-class-properties');
})
// enables @babel/preset-env polyfills
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = 3;
})
;
// Welcome page stylesheets
Encore.addEntry('welcome_page', [
path.resolve(__dirname, './assets/scss/welcome-page.scss'),
]);
Encore.addEntry('app', './assets/app.js');
const projectConfig = Encore.getWebpackConfig();
projectConfig.name = 'app';
module.exports = [ eZConfig, ...customConfigs, projectConfig ];
// uncomment this line if you've commented-out the above lines
// module.exports = [ eZConfig, ...customConfigs ];