only regen images on release

This commit is contained in:
Brahim Hadriche committed 2023-10-08 12:11:30 -04:00
1 parent 508306c6f4
commit b489735af9
1 file changed
+9
+9
View File
@@ -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 });