mirror of
https://github.com/AeThex-Corporation/AeThex-OS.git
synced 2026-04-17 22:27:19 +00:00
Fix ESM module compatibility: convert build to ESM format with proper require/dirname shims for Supabase
This commit is contained in:
parent
e3e894ca61
commit
6ed11341d1
2 changed files with 6 additions and 3 deletions
|
|
@ -7,7 +7,7 @@
|
|||
"dev:client": "vite dev --port 5000",
|
||||
"dev": "NODE_ENV=development tsx server/index.ts",
|
||||
"build": "tsx script/build.ts",
|
||||
"start": "NODE_ENV=production node dist/index.cjs",
|
||||
"start": "NODE_ENV=production node dist/index.js",
|
||||
"check": "tsc",
|
||||
"db:push": "drizzle-kit push"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -50,14 +50,17 @@ async function buildAll() {
|
|||
entryPoints: ["server/index.ts"],
|
||||
platform: "node",
|
||||
bundle: true,
|
||||
format: "cjs",
|
||||
outfile: "dist/index.cjs",
|
||||
format: "esm",
|
||||
outfile: "dist/index.js",
|
||||
define: {
|
||||
"process.env.NODE_ENV": '"production"',
|
||||
},
|
||||
minify: true,
|
||||
external: externals,
|
||||
logLevel: "info",
|
||||
banner: {
|
||||
js: "import { createRequire } from 'module'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; const require = createRequire(import.meta.url); const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename);",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue