electron-vite/bin/electron-vite.js

31 lines
722 B
JavaScript
Raw Permalink Normal View History

2022-03-17 09:21:02 +01:00
#!/usr/bin/env node
const debugIndex = process.argv.findIndex(arg => /^(?:-d|--debug)$/.test(arg))
const filterIndex = process.argv.findIndex(arg => /^(?:-f|--filter)$/.test(arg))
if (debugIndex > 0) {
let value = process.argv[debugIndex + 1]
if (!value || value.startsWith('-')) {
value = 'vite:*'
} else {
value = value
.split(',')
.map(v => `vite:${v}`)
.join(',')
}
process.env.DEBUG = `${process.env.DEBUG ? process.env.DEBUG + ',' : ''}${value}`
if (filterIndex > 0) {
const filter = process.argv[filterIndex + 1]
if (filter && !filter.startsWith('-')) {
process.env.VITE_DEBUG_FILTER = filter
}
}
}
function run() {
2023-12-08 15:03:47 +01:00
import('../dist/cli.mjs')
2022-03-17 09:21:02 +01:00
}
run()