Skip to content

Commit

Permalink
fix(dev): disable forked mode by default for bun and test (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored Sep 7, 2023
1 parent 2191619 commit faa168e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { fork } from 'node:child_process'
import { resolve } from 'pathe'
import { setupDotenv } from 'c12'
import { defineCommand, ParsedArgs } from 'citty'
import { isBun, isTest } from 'std-env'
import {
getArgs as getListhenArgs,
parseArgs as parseListhenArgs,
Expand All @@ -19,6 +20,8 @@ import type { NuxtOptions } from '@nuxt/schema'
import type { IncomingMessage, ServerResponse } from 'node:http'
import type { NuxtDevIPCMessage } from '../utils/dev'

const forkSupported = !isBun && !isTest

const command = defineCommand({
meta: {
name: 'dev',
Expand All @@ -38,8 +41,8 @@ const command = defineCommand({
},
fork: {
type: 'boolean',
description: 'Disable forked mode',
default: true,
description: forkSupported ? 'Disable forked mode' : 'Enable forked mode',
default: forkSupported,
},
},
async run(ctx) {
Expand Down

0 comments on commit faa168e

Please sign in to comment.