-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.js
42 lines (39 loc) · 1.04 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 webpack = require('webpack');
const packageJson = require('./package');
const outDir = process.env.RUNTYPER ? 'dist-runtyper' : 'dist';
const outFile = `bro-fs${process.env.NODE_ENV === 'production' ? '.min' : ''}.js`;
module.exports = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
entry: './src',
output: {
path: path.resolve(outDir),
filename: outFile,
libraryTarget: 'umd',
library: 'fs',
},
devtool: 'source-map',
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
plugins: process.env.RUNTYPER ? [
['babel-plugin-runtyper', {
warnLevel: 'break',
implicitEqualUndefined: 'allow',
}]
] : []
}
}
}
]
},
plugins: [
new webpack.BannerPlugin(`bro-fs v${packageJson.version}`)
]
};