This repository was archived by the owner on Dec 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathwebpack.config.babel.js
78 lines (66 loc) · 1.82 KB
/
webpack.config.babel.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
68
69
70
71
72
73
74
75
76
77
78
import webpack from 'webpack'
import path from 'path'
const resolveSrcPath = (filePath) => path.resolve(__dirname, `./src/${filePath}`)
const globals = {
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}
const webpackConfig = {
mode: 'production',
node: {
fs: 'empty'
},
entry: {
'auth': resolveSrcPath('swap.auth/index.js'),
'orders': resolveSrcPath('swap.orders/index.js'),
'room': resolveSrcPath('swap.room/index.js'),
'app': resolveSrcPath('swap.app/index.js'),
'flows': resolveSrcPath('swap.flows/index.js'),
'swap': resolveSrcPath('swap.swap/index.js'),
'swaps': resolveSrcPath('swap.swaps/index.js'),
'core': resolveSrcPath('index.js'),
},
output: {
path: path.join(__dirname, 'umd'),
filename: 'swap.[name].js',
libraryTarget: 'umd',
library: [ 'swap', '[name]' ],
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
}
]
},
resolve: {
symlinks: false,
modules: [
path.resolve(__dirname, '..', 'node_modules'),
'node_modules'
],
alias: {
'swap.auth': resolveSrcPath('swap.auth'),
'swap.orders': resolveSrcPath('swap.orders'),
'swap.room': resolveSrcPath('swap.room'),
'swap.app': resolveSrcPath('swap.app'),
'swap.flows': resolveSrcPath('swap.flows'),
'swap.swap': resolveSrcPath('swap.swap'),
'swap.swaps': resolveSrcPath('swap.swaps'),
},
},
plugins: [
new webpack.DefinePlugin(globals),
new webpack.ProvidePlugin({
'swap.auth': 'swap.auth',
'swap.orders': 'swap.orders',
'swap.room': 'swap.room',
'swap.app': 'swap.app',
'swap.flows': 'swap.flows',
'swap.swap': 'swap.swap',
'swap.swaps': 'swap.swaps',
}),
],
}
export default webpackConfig