From d4ecf66b11072a19ed05b57d1c270dbcc0272150 Mon Sep 17 00:00:00 2001 From: alvarosabu Date: Thu, 10 Oct 2024 16:25:47 +0200 Subject: [PATCH] chore: force npm run dev to always stub the build for dev --- package.json | 2 +- src/program.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4821603..d22cabc 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "scripts": { "build": "unbuild", "build:stub": "unbuild --stub", - "dev": "node dist/index.mjs", + "dev": "pnpm run build:stub && STUB=true node dist/index.mjs", "lint": "eslint .", "lint:fix": "eslint . --fix", "test": "vitest", diff --git a/src/program.ts b/src/program.ts index e42ce34..22bdbb1 100644 --- a/src/program.ts +++ b/src/program.ts @@ -5,7 +5,7 @@ import { resolve } from 'pathe' import { __dirname, handleError } from './utils' // Read package.json for metadata -const packageJsonPath = resolve(__dirname, process.env.VITEST ? '../../package.json' : '../../package.json') +const packageJsonPath = resolve(__dirname, process.env.VITEST || process.env.STUB ? '../../package.json' : '../package.json') const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')) // Declare a variable to hold the singleton instance