-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
35 lines (33 loc) · 952 Bytes
/
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
const path = require('path');
const entries = ['d3-chord/v3.0.1', 'd3/v7.9.0', 'd3-sankey/v0.12.3', 'dom-api'];
module.exports = {
context: __dirname,
entry: {
'@gravity-ui/date-utils/v2.3.0': {
import: '@gravity-ui/date-utils.2.3.0',
},
'@gravity-ui/date-utils/v2.5.3': {
import: '@gravity-ui/date-utils.2.5.3',
},
'lodash/v4.17.21': {
import: 'lodash.4.17.21',
},
...entries.reduce((acc, entry) => {
acc[entry] = path.resolve(__dirname, `./src/entries/${entry.replace('/', '_')}.js`);
return acc;
}, {}),
},
mode: 'production',
output: {
globalObject: 'this',
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
chunkFormat: 'commonjs',
library: {
type: 'global',
},
},
resolve: {
extensions: ['.ts', '.js'],
}
};