diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index f9a2cab..5784e12 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -47,7 +47,7 @@ jobs: - name: Build Package run: npm run build - name: Publish Package - run: npm publish + run: npm publish --tag next env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/src/server/management/client.ts b/src/server/management/client.ts index 59d713d..0f74a25 100644 --- a/src/server/management/client.ts +++ b/src/server/management/client.ts @@ -3,11 +3,15 @@ import { existsSync } from 'fs'; import { Request, Response } from 'express'; import { KrasConfiguration, KrasServer } from '../types'; +// this only exists to trick "ncc" -> otherwise it tries to resolve it +// directly at compile-time +const indexHtml = [0].map(() => 'index.html').pop(); + function getClient(cwd: string, path: string) { const fullPath = resolve(cwd, path); if (!existsSync(fullPath)) { - const indexPath = resolve(fullPath, 'index.html'); + const indexPath = resolve(fullPath, indexHtml); if (existsSync(indexPath)) { return indexPath; @@ -18,7 +22,7 @@ function getClient(cwd: string, path: string) { paths: [__dirname, process.cwd(), cwd], }); const mainDir = dirname(mainPath); - return resolve(mainDir, 'index.html'); + return resolve(mainDir, indexHtml); } catch {} }