forked from MyEtherWallet/MEWconnect-web-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
53 lines (52 loc) · 1.51 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
const path = require('path')
const webpack = require('webpack')
module.exports = {
mode: 'none', // "production" | "development" | "none"
entry: {
MewConnectBrowserTest: [/*'babel-polyfil', */'../specs/MewConnectInitiator.spec.js']
},
output: {
path: __dirname, // string
filename: '[name].min.js',
// library: 'MewConnect', // string,
// the name of the exported library
// TODO figure out the best option to use here
// libraryTarget: 'umd', // umd', // "var" | "assign" | "this" | "window" | "global" | "commonjs" | "commonjs2" | "amd" | "umd"
// the type of the exported library
// globalObject: 'this'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components|dist)/,
use: {
loader: 'babel-loader',
options: {
plugins: [require('babel-plugin-transform-object-rest-spread')],
presets: ["env"]
}
}
}
]
},
resolve: {
modules: [
'node_modules',
path.resolve(__dirname, 'src')
],
extensions: ['.js', '.json', '.jsx', '.css']
},
performance: {
hints: 'warning', // enum
maxAssetSize: 200000, // int (in bytes),
maxEntrypointSize: 400000 // int (in bytes)
},
devtool: 'source-map', // enum
context: __dirname, // string (absolute path!)
target: 'web', // enum
// the environment in which the bundle should run
plugins: [
new webpack.DefinePlugin({'process.env.NODE_ENV': JSON.stringify('production')})
]
}