fix(directory): fixed an issue where _assets is not build by default

This commit is contained in:
Haoyu Xu
2023-06-23 08:44:57 -04:00
parent dd2c1d5d91
commit fc0a1a5de8
3 changed files with 20 additions and 7 deletions

View File

@@ -1 +1 @@
3.6.6
3.6.9

View File

@@ -1 +1 @@
1.2.8
1.2.10

View File

@@ -5,8 +5,11 @@ import { defineConfig } from 'vite'
import assert from 'assert'
import react from '@vitejs/plugin-react-swc'
import getConfig from './libs/config.js'
import { rmdir, writeSync } from './libs/file.js'
import { rmdir } from './libs/file.js'
import { increase } from './libs/version.js'
import Music from './libs/music.js';
import Background from './libs/background.js'
import directory from './libs/directory.js'
import { PerfseePlugin } from '@perfsee/rollup'
global.__projectRoot = path.dirname(fileURLToPath(import.meta.url))
@@ -51,14 +54,15 @@ class ViteRunner {
}
break
default:
return
return null
}
return result
}
start() {
async start() {
const configObj = this.config
const viteConfig = configObj.data;
switch (this.#mode) {
case 'dev':
this.#dev(viteConfig)
@@ -191,9 +195,18 @@ class ViteRunner {
}
async function main() {
if (process.env.npm_lifecycle_event.includes('vite')) return
if (process.env.npm_lifecycle_event.includes('vite')) {
global.__config = getConfig()
const background = new Background()
await background.process()
const backgrounds = ['operator_bg.png', ...background.files]
const { musicMapping } = Music()
directory({ backgrounds, musicMapping })
return
}
const runner = new ViteRunner()
runner.start()
await runner.start()
}
main()