Skip to content

Commit

Permalink
only regen images on release
Browse files Browse the repository at this point in the history
  • Loading branch information
iBicha committed Oct 8, 2023
1 parent 508306c commit b489735
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/bs-plugins/image-gen-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit b489735

Please sign in to comment.