forked from autonomoussoftware/metronome-contracts-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
46 lines (38 loc) · 956 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
39
40
41
42
43
44
45
46
'use strict'
const path = require('path')
const isProd = process.env.NODE_ENV === 'production'
const library = 'metronome-contracts'
const outputFile = isProd ? `${library}.min.js` : `${library}.js`
module.exports = {
target: 'web',
entry: path.resolve(__dirname, './src/index.js'),
mode: isProd ? 'production' : 'development',
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
filename: outputFile,
libraryTarget: 'umd',
library
},
module: {
rules: [
{
test: /\.js$/,
loader: 'eslint-loader',
enforce: 'pre',
exclude: /node_modules/,
include: [path.resolve(__dirname, './src')]
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/,
include: [path.resolve(__dirname, './src')]
}
]
},
performance: {
hints: false
},
devtool: isProd ? '#eval-source-map' : false
}