Skip to content

Commit

Permalink
Ignore virtual files
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcompiles committed Jul 20, 2023
1 parent 422ff3f commit 73f6ba9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/integration/src/inlineCompiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,16 @@ export class InlineCompiler {

filePath = isAbsolute(filePath) ? filePath : join(this.root, filePath);

// TODO: Improve perf. Reading all files from disk is wasteful.
// We can likely cache using the module graph
const code = await readFile(filePath, { encoding: 'utf-8' });
let code;

try {
// TODO: Improve perf. Reading all files from disk is wasteful.
// We can likely cache using the module graph
code = await readFile(filePath, { encoding: 'utf-8' });
} catch (e) {
// Ignore virtual files
return null;
}
const { shouldProcess, isLegacyCssFile } = await this.analyseModule(
code,
filePath,
Expand Down

0 comments on commit 73f6ba9

Please sign in to comment.