-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.js
63 lines (56 loc) · 1.73 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
process.traceDeprecation = true;
const mf_config = require('@patternslib/dev/webpack/webpack.mf');
const path = require('path');
const package_json = require('./package.json');
const package_json_mockup = require('@plone/mockup/package.json');
const package_json_patternslib = require('@patternslib/patternslib/package.json');
const webpack_config =
require('@patternslib/dev/webpack/webpack.config').config;
module.exports = () => {
let config = {
entry: {
'manageusers.min': path.resolve(
__dirname,
'src/rer/newsletter/browser/static/scripts/index_manageusers',
),
'channelhistory.min': path.resolve(
__dirname,
'src/rer/newsletter/browser/static/scripts/index_channelhistory',
),
'initializedModal.min': path.resolve(
__dirname,
'src/rer/newsletter/browser/static/scripts/index_initializedModal',
),
},
};
config = webpack_config({
config: config,
package_json: package_json,
});
config.output.path = path.resolve(
__dirname,
'src/rer/newsletter/browser/static/scripts/prod',
);
config.module.rules.push({
test: /\.svg$/i,
type: 'asset/resource',
});
config.plugins.push(
mf_config({
name: 'rer.newsletter',
filename: 'bundle-remote.min.js',
remote_entry: config.entry['manageusers.min'],
dependencies: {
...package_json_patternslib.dependencies,
...package_json_mockup.dependencies,
...package_json.dependencies,
},
}),
);
if (process.env.NODE_ENV === 'development') {
config.devServer.port = '3001';
config.devServer.static.directory = path.resolve(__dirname, './resources/');
}
// console.log(JSON.stringify(config, null, 4));
return config;
};