forked from aeternity/hd-wallet-js
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.js
38 lines (35 loc) · 851 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
36
37
38
const path = require('path')
const common = (env, argv) => {
return {
entry: './src/index.js',
mode: 'development',
devtool: argv.mode === 'production' ? false : 'eval-source-map',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader!standard-loader?error=true'
},
{
test: /^assets\/swagger\/.*\.json$/,
loader: 'import-glob-loader'
}
]
}
}
}
function configure (filename, opts = {}) {
return (env, argv) => Object.assign({
output: {
path: path.resolve(__dirname, 'dist'),
filename,
library: 'AeternityClient',
libraryTarget: 'umd'
}
}, common(env, argv), opts)
}
module.exports = [
configure('wallet.js', { target: 'node' }),
configure('wallet.browser.js')
]