-
Notifications
You must be signed in to change notification settings - Fork 22
/
webpack.config.js
42 lines (40 loc) · 1.31 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
const path = require('path')
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin')
let minifiedOutput = process.env.WEBPACK_ENV === 'minified'
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: minifiedOutput ? 'gnosis-pm.min.js' : 'gnosis-pm.js',
library: 'Gnosis'
},
plugins: [
new LodashModuleReplacementPlugin()
],
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
module: {
rules: [
{
test: /\.css$/,
use: [ 'style-loader', 'css-loader' ]
},
{
test: /\/build\/contracts\/\w+\.json$/,
use: ['json-x-loader?exclude=unlinked_binary+networks.*.events+networks.*.links+bytecode+deployedBytecode+sourceMap+deployedSourceMap+source+sourcePath+ast+legacyAST']
},
{
test: /\/gas-stats.json$/,
use: ['json-x-loader?exclude=*.*.data']
},
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader'
}
]
},
devtool: 'source-map',
devServer: {
contentBase: path.join(__dirname, 'examples')
}
}