-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathwebpack.config.js
More file actions
52 lines (48 loc) · 1.32 KB
/
webpack.config.js
File metadata and controls
52 lines (48 loc) · 1.32 KB
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
'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/index",
output: {
path: path.resolve(__dirname, "dist", "browser"),
filename: "steem-content-renderer.min.js",
library: "SteemContentRenderer",
libraryTarget: "umd"
},
devtool: (DEFAULTS.isDevelopment ? 'cheap-eval-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 ow
},
plugins: [
new Visualizer({
filename: './statistics.html'
}),
new webpack.DefinePlugin({
'process.env': (process.env.NODE_ENV === 'production') ? {
NODE_ENV: '"production"'
} : {
NODE_ENV: '"development"'
},
"_WEBPACK_BUILD": JSON.stringify(true),
}),
]
}