fix(tongji): stabilize food transitions and mixed weekly rank
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
import type { Plugin } from 'vite'
|
||||
|
||||
const FOOD_ICON_FILES = [
|
||||
'tofu.jpg',
|
||||
'spinach.jpg',
|
||||
'carrot.jpg',
|
||||
'fish.jpg',
|
||||
'redBeanCongee.jpg'
|
||||
]
|
||||
|
||||
/**
|
||||
* Keep endless-game food icons inside the tongji subpackage.
|
||||
* Importing them from Vue would make Vite emit them into the main-package assets folder.
|
||||
*/
|
||||
export function tongjiFoodAssetsPlugin(): Plugin {
|
||||
return {
|
||||
name: 'tongji-food-assets',
|
||||
apply: 'build',
|
||||
generateBundle() {
|
||||
FOOD_ICON_FILES.forEach((fileName) => {
|
||||
this.emitFile({
|
||||
type: 'asset',
|
||||
fileName: `tongji/endless-game/assets/food/${fileName}`,
|
||||
source: readFileSync(resolve(process.cwd(), 'tongji/endless-game/assets/food', fileName))
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user