x
This commit is contained in:
13
frontend/scripts/run-dev.mjs
Normal file
13
frontend/scripts/run-dev.mjs
Normal file
@@ -0,0 +1,13 @@
|
||||
import { spawnSync } from 'node:child_process'
|
||||
import { dirname, join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
|
||||
const inner = join(root, 'scripts', 'run-dev-inner.mjs')
|
||||
const major = parseInt(process.versions.node.split('.')[0], 10)
|
||||
|
||||
const cmd = major >= 20 ? process.execPath : 'npx'
|
||||
const args = major >= 20 ? [inner] : ['-y', '-p', 'node@20', 'node', inner]
|
||||
|
||||
const r = spawnSync(cmd, args, { stdio: 'inherit', cwd: root, shell: false })
|
||||
process.exit(r.status ?? 1)
|
||||
Reference in New Issue
Block a user