-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
32 lines (32 loc) · 1.03 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
const TerserPlugin = require( "terser-webpack-plugin" );
const path = require( "path" );
module.exports = {
mode: "production",
target: [ "es2020" ],
entry: "./src/index.ts",
output: {
path: path.resolve( __dirname, "./build/packs/Behavior Pack/scripts" ),
filename: "index.js",
chunkFormat: "commonjs",
},
resolve: { extensions: [ ".ts", ".tsx", ".js" ] },
experiments: { outputModule: true },
externalsType: "module",
externals: {
"@minecraft/server": "@minecraft/server",
"@minecraft/server-ui": "@minecraft/server-ui",
"@minecraft/server-net": "@minecraft/server-net",
"@minecraft/server-admin": "@minecraft/server-admin",
"@minecraft/server-editor": "@minecraft/server-editor",
"@minecraft/server-gametest": "@minecraft/server-gametest",
"@minecraft/server-editor-bindings": "@minecraft/server-editor-bindings",
},
module: { rules: [{ test: /\.tsx?$/, loader: "ts-loader" }] },
plugins: [
new TerserPlugin({
terserOptions: {
output: { comments: false },
},
}),
],
};