unity-puerts-template/rspack.config.ts

22 lines
559 B
TypeScript
Raw Normal View History

2025-03-30 12:27:26 +08:00
import { defineConfig } from "@rspack/cli";
2025-03-30 12:36:13 +08:00
import { resolve } from "path/win32";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = resolve(__filename, "..");
2025-03-30 12:16:05 +08:00
export default defineConfig({
entry: {
2025-03-30 12:27:26 +08:00
main: "./src/index.ts",
2025-03-30 12:16:05 +08:00
},
2025-03-30 12:27:26 +08:00
externalsType: "var",
2025-03-30 12:16:05 +08:00
externals: {
2025-03-30 12:27:26 +08:00
unityengine: "CS.UnityEngine",
"unityengine/ui": "CS.UnityEngine.UI",
"system": "CS.System",
2025-03-30 14:16:06 +08:00
"tmpro": "CS.TMPro",
2025-03-30 12:27:26 +08:00
},
2025-03-30 12:36:13 +08:00
output: {
path: resolve(__dirname, "Gen/Resources"),
filename: "[name].mjs",
},
2025-03-30 12:16:05 +08:00
});