-
Notifications
You must be signed in to change notification settings - Fork 43
/
ez.webpack.config.js
39 lines (31 loc) · 1.11 KB
/
ez.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 path = require('path');
const bundles = require('./var/encore/ez.config.js');
const eZConfigManager = require('./ez.webpack.config.manager.js');
const configManagers = require('./var/encore/ez.config.manager.js');
module.exports = (Encore) => {
Encore.setOutputPath('public/assets/ezplatform/build')
.setPublicPath('/assets/ezplatform/build')
.addExternals({
react: 'React',
'react-dom': 'ReactDOM',
jquery: 'jQuery',
moment: 'moment',
'popper.js': 'Popper',
alloyeditor: 'AlloyEditor',
'prop-types': 'PropTypes',
})
.enableSassLoader()
.enableReactPreset()
.enableSingleRuntimeChunk();
bundles.forEach((configPath) => {
const addEntries = require(configPath);
addEntries(Encore);
});
const eZConfig = Encore.getWebpackConfig();
eZConfig.name = 'ezplatform';
configManagers.forEach((configManagerPath) => {
const configManager = require(configManagerPath);
configManager(eZConfig, eZConfigManager);
});
return eZConfig;
};