From b489735af9368c002c715cb0384666f66fd46004 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sun, 8 Oct 2023 12:11:30 -0400 Subject: [PATCH] only regen images on release --- tools/bs-plugins/image-gen-plugin.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/bs-plugins/image-gen-plugin.ts b/tools/bs-plugins/image-gen-plugin.ts index acff95cf..d2648bdd 100644 --- a/tools/bs-plugins/image-gen-plugin.ts +++ b/tools/bs-plugins/image-gen-plugin.ts @@ -17,6 +17,15 @@ export class ImageGenPlugin implements CompilerPlugin { public name = 'ImageGenPlugin'; beforeProgramCreate(builder: ProgramBuilder) { + // Debug flag + // @ts-ignore + const debug = !!builder.options.debug; + if (debug) { + // Since the plugin does a lot of scanning of files, it is fine not to run it in debug mode + // The change will be picked up on release + return; + } + const rootDir = builder.options.rootDir!; const svgFiles = globSync(`**/*.svg`, { cwd: rootDir });