File tree Expand file tree Collapse file tree
adminforth/commands/createApp/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,4 +5,5 @@ ADD package.json {{dockerAdditionalManifestFiles}} /code/
55RUN {{ packageManager }} {{ dockerPackageInstallSubcommand }}
66ADD . /code/
77RUN {{ packageManagerExec }} adminforth bundle
8+ RUN {{ packageManager }} run build
89CMD ["sh", "-c", "{{ packageManagerRun }} migrate:prod && {{ packageManagerRun }} prod"]
Original file line number Diff line number Diff line change @@ -75,9 +75,11 @@ if (fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) {
7575
7676 const port = 3500;
7777
78- admin.bundleNow({ hotReload: process.env.NODE_ENV === 'development' }).then(() => {
79- logger.info('Bundling AdminForth SPA done.');
80- });
78+ if (process.env.NODE_ENV === 'development') {
79+ admin.bundleNow({ hotReload: true }).then(() => {
80+ logger.info('Bundling AdminForth SPA done.');
81+ });
82+ }
8183
8284 admin.express.serve(app);
8385
Original file line number Diff line number Diff line change 99 "description": "",
1010 "scripts": {
1111 "dev": "{{ packageManagerEnvDev }} tsx watch index.ts",
12- "prod": "{{ packageManagerEnvProd }} tsx index.ts",
12+ "build": "{{ packageManagerEnvProd }} tsup index.ts --format esm --clean",
13+ "prod": "{{ packageManagerEnvProd }} node dist/index.js",
1314 "start": "{{ packageManagerRun }} dev",
1415 {{ #if includePrismaMigrations }}
1516 "makemigration": "{{ packageManagerEnvDev }} npx --yes prisma migrate dev --create-only",
3031 },
3132 "devDependencies": {
3233 "typescript": "6.0.3",
34+ "tsup": "^8.5.1",
3335 "tsx": "4.11.2",
3436 "@types/express": "^4.17.21",
3537 "@types/node": "latest",
You can’t perform that action at this time.
0 commit comments