mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 05:38:04 +00:00
feat: 解决build bug
This commit is contained in:
parent
46fe2d734e
commit
e99c4833f7
47 changed files with 1236 additions and 611 deletions
|
|
@ -5,10 +5,19 @@ import electron from 'electron'
|
|||
import { spawn } from 'child_process'
|
||||
import path from 'path'
|
||||
import waitOn from 'wait-on'
|
||||
import 'dotenv/config'
|
||||
import dotenv from 'dotenv'
|
||||
import pc from 'picocolors'
|
||||
import minimist from 'minimist'
|
||||
|
||||
const env = dotenv.config({
|
||||
path: path.resolve(process.cwd(), '.env'),
|
||||
})
|
||||
const envForEsbuild = {}
|
||||
Object.entries(env.parsed).forEach(([key, value]) => {
|
||||
envForEsbuild[`process.env.${key}`] = `"${value}"`
|
||||
})
|
||||
console.log(envForEsbuild)
|
||||
|
||||
const argv = minimist(process.argv.slice(2))
|
||||
const TAG = '[script/build.main.ts]'
|
||||
const spinner = ora(`${TAG} Main Process Building...`)
|
||||
|
|
@ -19,6 +28,7 @@ const options = {
|
|||
platform: 'node',
|
||||
format: 'cjs',
|
||||
bundle: true,
|
||||
define: envForEsbuild,
|
||||
external: [
|
||||
...builtinModules.filter(
|
||||
x => !/^_|^(internal|v8|node-inspect)\/|\//.test(x)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue