-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathwebpack.config.js
More file actions
44 lines (41 loc) · 871 Bytes
/
webpack.config.js
File metadata and controls
44 lines (41 loc) · 871 Bytes
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
const path = require("path");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const mode = process.env.NODE_ENV || "development";
console.log("building for ", mode);
module.exports = {
mode,
entry: {
"gcode-viewer": "./src/index.ts",
"gcode-viewer.min": "./src/index.ts",
},
output: {
path: path.resolve(__dirname, "_bundles"),
filename: "[name].js",
libraryTarget: "umd",
library: "gcodeViewer",
umdNamedDefine: true,
},
resolve: {
alias: {
three: path.resolve("./node_modules/three"),
},
extensions: [".ts", ".js"],
},
devtool: "source-map",
optimization: {
minimizer: [
new UglifyJsPlugin({
sourceMap: true,
include: /\.min\.js$/,
}),
],
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
},
],
},
};