-
Notifications
You must be signed in to change notification settings - Fork 10
/
ibexa.webpack.config.js
50 lines (38 loc) · 1.45 KB
/
ibexa.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
const bundles = require('./var/encore/ibexa.config.js');
const ibexaConfigManager = require('./ibexa.webpack.config.manager.js');
const configManagers = require('./var/encore/ibexa.config.manager.js');
const configSetups = require('./var/encore/ibexa.config.setup.js');
const path = require('path');
module.exports = (Encore) => {
Encore.setOutputPath('public/assets/ibexa/build')
.setPublicPath('/assets/ibexa/build')
.addExternals({
react: 'React',
'react-dom': 'ReactDOM',
moment: 'moment',
'popper.js': 'Popper',
alloyeditor: 'AlloyEditor',
'prop-types': 'PropTypes',
})
.enableSassLoader()
.enableReactPreset()
.enableSingleRuntimeChunk();
configSetups.forEach((configSetupPath) => {
const setupConfig = require(configSetupPath);
setupConfig(Encore);
});
bundles.forEach((configPath) => {
const addEntries = require(configPath);
addEntries(Encore);
});
const ibexaConfig = Encore.getWebpackConfig();
ibexaConfig.name = 'ibexa';
ibexaConfig.module.rules[4].oneOf[1].use[1].options.url = false;
ibexaConfig.module.rules[1].oneOf[1].use[1].options.url = false;
configManagers.forEach((configManagerPath) => {
const configManager = require(configManagerPath);
configManager(ibexaConfig, ibexaConfigManager);
});
Encore.reset();
return ibexaConfig;
};