Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

feat(node): upgrade minimum version #61

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bin/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))
const project = path.join(__dirname, '../tsconfig.json')
const dev = fs.existsSync(project) && process.env.DEBUG != 'false'

if (dev && !process.env.NODE_OPTIONS?.includes('--loader ts-node/esm')) {
if (dev && !process.env.NODE_OPTIONS?.includes('--import tsx/esm')) {
await new Promise((resolve, reject) => {
const subprocess = spawn(process.argv[0], [...process.argv.slice(1)], {
cwd: process.cwd(),
env: { ...process.env, NODE_OPTIONS: `--loader ts-node/esm/transpile-only --enable-source-maps ${process.env.NODE_OPTIONS ?? ''}` },
env: { ...process.env, NODE_OPTIONS: `--import tsx/esm --enable-source-maps ${process.env.NODE_OPTIONS ?? ''}` },
stdio: 'inherit',
})

Expand All @@ -32,5 +32,5 @@ if (dev && !process.env.NODE_OPTIONS?.includes('--loader ts-node/esm')) {
process.exit(0)
}

const { run } = dev ? await import('../src/index.js') : await import('../.dist/index.js')
const { run } = dev ? await import('../src/index.ts') : await import('../.dist/index.js')
await run().catch(console.error)
Loading
Loading