| 1 | |
| 2 | import { createRequire } from "node:module"; |
| 3 | import { fileURLToPath, pathToFileURL } from "node:url"; |
| 4 | import { resolve } from "node:path"; |
| 5 | |
| 6 | const ui = fileURLToPath(new URL("../ui/", import.meta.url)); |
| 7 | const require = createRequire(new URL("../ui/package.json", import.meta.url)); |
| 8 | const { build } = await import(pathToFileURL(require.resolve("vite"))); |
| 9 | const { default: react } = await import(pathToFileURL(require.resolve("@vitejs/plugin-react"))); |
| 10 | await build({ |
| 11 | root: ui, |
| 12 | configFile: false, |
| 13 | publicDir: false, |
| 14 | plugins: [react()], |
| 15 | build: { |
| 16 | outDir: fileURLToPath(new URL("./.build/resources/mobile-ui/", import.meta.url)), |
| 17 | emptyOutDir: true, |
| 18 | rolldownOptions: { input: resolve(ui, "mobile.html") }, |
| 19 | }, |
| 20 | }); |