forked from JaylyDev/interpreter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
57 lines (56 loc) · 1.41 KB
/
Copy pathwebpack.config.js
File metadata and controls
57 lines (56 loc) · 1.41 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
53
54
55
56
57
const path = require("node:path");
const srcScriptsPath = path.resolve(__dirname, 'src', 'behavior_pack', 'scripts');
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
const tsconfig = require(path.join(srcScriptsPath, "tsconfig.json"));
/**
* @type {import('webpack').Configuration}
*/
module.exports = {
entry: path.join(srcScriptsPath, "index.ts"),
devtool: 'source-map',
mode: "production",
target: ["es2020"],
// ------ ^
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/,
},
],
},
resolve: {
fallback: {
'buffer': false,
'inspector': false,
'os': false,
'path': false,
'fs': false
},
extensions: [".tsx", ".ts", ".js"],
plugins: [
new TsconfigPathsPlugin({
configFile: path.resolve(srcScriptsPath, "tsconfig.json"),
}),
],
},
optimization: {
minimize: false,
},
output: {
filename: "index.js",
path: path.resolve(srcScriptsPath, tsconfig.compilerOptions.outDir),
},
experiments: {
outputModule: true,
},
externalsType: "module",
externals: {
"@minecraft/server": "@minecraft/server",
"@minecraft/server-ui": "@minecraft/server-ui",
"@minecraft/server-admin": "@minecraft/server-admin",
"@minecraft/server-gametest": "@minecraft/server-gametest",
"@minecraft/server-net": "@minecraft/server-net",
},
};