-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.js
44 lines (40 loc) · 1.02 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
'use strict';
const Visualizer = require('webpack-visualizer-plugin');
const path = require('path');
const webpack = require('webpack');
const DEFAULTS = {
isDevelopment: process.env.NODE_ENV !== 'production',
baseDir: path.join(__dirname, '..'),
};
module.exports = {
mode: (DEFAULTS.isDevelopment ? "development" : "production"),
entry: "./dist/wise",
output: {
path: path.resolve(__dirname, "dist/browser"),
filename: "wise.min.js",
library: "wise",
libraryTarget: "umd"
},
devtool: (DEFAULTS.isDevelopment ? 'cheap-eval-source-map' : 'source-map'),
target: "web",
module: {
rules: []
},
optimization: {
minimize: (DEFAULTS.isDevelopment ? false : true)
},
performance: {
hints: false
},
resolve: {
extensions: [".js", ".json"]
},
node: {
fs: "empty" // fix can't resolve "fs" in winston
},
plugins: [
new Visualizer({
filename: './statistics.html'
})
]
}