diff --git a/packages/wb/src/project.ts b/packages/wb/src/project.ts index 4e06dc9b..4d08a609 100644 --- a/packages/wb/src/project.ts +++ b/packages/wb/src/project.ts @@ -7,8 +7,6 @@ import { memoizeFactory } from 'at-decorators'; import { globby } from 'globby'; import type { PackageJson } from 'type-fest'; -import { isRunningOnBun } from './utils/runtime.js'; - const memoize = memoizeFactory({ maxCachedThisSize: Number.MAX_SAFE_INTEGER, maxCachedArgsSize: 1 }); export class Project { @@ -35,11 +33,9 @@ export class Project { @memoize get buildCommand(): string { - return isRunningOnBun - ? 'true' - : this.packageJson.scripts?.build?.includes('buildIfNeeded') - ? 'yarn build' - : `YARN wb buildIfNeeded ${this.argv.verbose ? '--verbose' : ''}`; + return this.packageJson.scripts?.build?.includes('buildIfNeeded') + ? 'YARN build' + : `YARN wb buildIfNeeded ${this.argv.verbose ? '--verbose' : ''}`; } get dirPath(): string { diff --git a/packages/wb/src/scripts/run.ts b/packages/wb/src/scripts/run.ts index 659b6610..659af03d 100644 --- a/packages/wb/src/scripts/run.ts +++ b/packages/wb/src/scripts/run.ts @@ -103,6 +103,7 @@ function normalizeScript(script: string, project: Project): [string, string] { if (isRunningOnBun) { newScript = newScript .replaceAll('build-ts run', 'bun --bun run') + .replaceAll('bun --bun run bun --bun run', 'bun --bun run') .replaceAll('dist/index.js', 'src/index.ts') .replaceAll(/(YARN )?vitest run/g, 'bun test') .replaceAll(' --color --passWithNoTests --allowOnly', '');