forked from shexjs/shex.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
53 lines (50 loc) · 1.43 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
45
46
47
48
49
50
51
52
53
const Path = require('path');
const TerserPlugin = require('terser-webpack-plugin');
const DocDir = "doc/"
const WebPacksDir = "webpacks/";
// webpack-bundle-analyzer can be run after compilation.
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
// webpack-monitor is noisy so disabled by default (uses a deprecated API).
const WebpackMonitor = !!JSON.parse(process.env["WEBPACK_MONITOR"] || "false")
? new (require('webpack-monitor'))({
capture: true,
target: 'browser/webpack-monitor.json',
launch: true
})
: []
module.exports = {
entry: {
"shex-webapp" : "./shex-webapp.js",
"shex-webapp.min": "./shex-webapp.js",
},
output: {
filename: "[name].js",
path: Path.resolve(__dirname, DocDir, WebPacksDir),
publicPath: WebPacksDir,
// libraryTarget: 'umd',
// libraryExport: 'ShExWebApp',
// umdNamedDefine: true,
// // globalObject: 'this'
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin({
terserOptions: {
"keep_classnames": false
},
include: /\.min\.js$/
})]
},
resolve: {
fallback: {
// fs: false, // TODO: update ShapeMapParser to use ts-jison
// path: false,
// net: 'empty',
// tls: 'empty',
url: require.resolve("url/"),
}
},
plugins: [
// new BundleAnalyzerPlugin(/*{analyzerMode: 'json'}*/)
].concat(WebpackMonitor)
};