-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
67 lines (62 loc) · 1.24 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
64
65
66
67
/* eslint-disable */
const Path = require('path');
const common = {
mode: process.env.NODE_ENV,
externals: {
"@jitesoft/sprintf": "@jitesoft/sprintf",
"@jitesoft/events": "@jitesoft/events"
},
devtool: false,
module: {
rules: [
{
test: /\.js$/,
exclude: [/node_modules/],
loader: 'babel-loader'
}
]
}
};
const index = Object.assign({}, common, {
entry: {
'index': [
Path.join(__dirname, 'src', 'Yolog.js')
]
},
output: {
filename: 'index.js',
libraryTarget: 'umd',
library: '@jitesoft/yolog',
globalObject: 'this',
}
});
const node = Object.assign({}, {
entry: {
'node': [
Path.join(__dirname, 'src', 'node', 'index.js')
]
},
target: 'node',
output: {
filename: 'node.js',
libraryTarget: 'umd',
library: '@jitesoft/yolog',
globalObject: 'this'
}
}, common);
const web = Object.assign({}, common, {
entry: {
'browser': [
Path.join(__dirname, 'src', 'web', 'index.js')
]
},
target: 'web',
output: {
filename: 'browser.js',
libraryTarget: 'umd',
library: '@jitesoft/yolog'
}
});
module.exports = [
index, node, web
];