feat: smart animation mode
This commit is contained in:
parent
7534a613cb
commit
1114828000
11 changed files with 207 additions and 44 deletions
1
src/compilers/Configuration.ts
Normal file
1
src/compilers/Configuration.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export const isBuildMode = process.argv.includes("--build")
|
||||
|
|
@ -4,6 +4,7 @@ import { UI } from "../components/UI.js"
|
|||
import { AnimType } from "../types/enums/AnimType.js"
|
||||
import { Renderer } from "../types/enums/Renderer.js"
|
||||
import { Type } from "../types/enums/Type.js"
|
||||
import { isBuildMode } from "./Configuration.js"
|
||||
|
||||
type Element = UI<Type, Renderer | null> | AnimationKeyframe<AnimType>
|
||||
interface FileInterface {
|
||||
|
|
@ -16,6 +17,7 @@ export class Memory extends Class {
|
|||
protected static files: Files = new Map<string, FileInterface>()
|
||||
|
||||
public static add(element: UI<Type, Renderer | null> | AnimationKeyframe<AnimType>) {
|
||||
if (!isBuildMode) return
|
||||
let file = Memory.files.get(element.path)
|
||||
|
||||
if (!file) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { isBuildMode } from "./Configuration.js"
|
||||
import { Memory } from "./Memory.js"
|
||||
|
||||
const isBuildMode = process.argv.includes("--build")
|
||||
|
||||
if (isBuildMode) {
|
||||
process.on("beforeExit", () => {
|
||||
console.log(JSON.stringify(Memory.build(), null, 2))
|
||||
|
|
|
|||
Reference in a new issue