Skip to content

Commit

Permalink
Merge pull request #9 from Swoorup/patch-1
Browse files Browse the repository at this point in the history
Fix random include failure
  • Loading branch information
vanruesc committed Sep 30, 2023
2 parents 3a40186 + 829c099 commit f752c45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/loadShader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ export async function load(filePath: string, cache: Map<string, string>,
const warnings: PartialMessage[] = [];
const watchFiles = new Set<string>();

cache.set(filePath, contents);

const importPattern = /#include +["']([.\\/\w-]+)["']/g;
const linebreakRegex = /\r|\n|\r\n/g;

Expand Down Expand Up @@ -118,6 +116,8 @@ export async function load(filePath: string, cache: Map<string, string>,
contents = contents.replace(include.target, include.contents);

}

cache.set(filePath, contents);

return { contents, warnings, watchFiles: [...watchFiles] };

Expand Down

0 comments on commit f752c45

Please sign in to comment.