-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
53 lines (43 loc) · 1.54 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
const Encore = require('@symfony/webpack-encore');
const path = require('path');
const getIbexaConfig = require('./ibexa.webpack.config.js');
const ibexaConfig = getIbexaConfig(Encore);
const customConfigs = require('./ibexa.webpack.custom.configs.js');
const {
isReactBlockPathCreated,
} = require('./ibexa.webpack.config.react.blocks.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)$/,
})
// enables @babel/preset-env polyfills
.configureBabelPresetEnv((config) => {
config.useBuiltIns = 'usage';
config.corejs = 3;
});
// Welcome page stylesheets
Encore.addEntry('welcome-page-css', [
path.resolve(__dirname, './assets/scss/welcome-page.scss'),
]);
// Welcome page javascripts
Encore.addEntry('welcome-page-js', [
path.resolve(__dirname, './assets/js/welcome.page.js'),
]);
if (isReactBlockPathCreated) {
// React Blocks javascript
Encore.addEntry('react-blocks-js', './assets/js/react.blocks.js');
}
Encore.addEntry('app', './assets/app.js');
const projectConfig = Encore.getWebpackConfig();
projectConfig.name = 'app';
module.exports = [ibexaConfig, ...customConfigs, projectConfig];
// uncomment this line if you've commented-out the above lines
// module.exports = [ eZConfig, ibexaConfig, ...customConfigs ];