mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-19 20:07:06 +08:00
15 lines
480 B
JavaScript
15 lines
480 B
JavaScript
|
import fs from 'fs'
|
||
|
import path from 'path'
|
||
|
import { fileURLToPath } from 'url'
|
||
|
import { createRequire } from 'module'
|
||
|
|
||
|
const pkg = createRequire(import.meta.url)('../package.json')
|
||
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
||
|
|
||
|
// write .debug.env
|
||
|
const envContent = Object.entries(pkg.env).map(([key, val]) => `${key}=${val}`)
|
||
|
fs.writeFileSync(path.join(__dirname, '.debug.env'), envContent.join('\n'))
|
||
|
|
||
|
// bootstrap
|
||
|
import('../scripts/watch.mjs?debug=vscode')
|