Skip to content

Commit

Permalink
Skip type import check
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Nov 30, 2022
1 parent f6cf218 commit 141c010
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/astro/src/vite-plugin-jsx/import-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function detectImportSource(
// Matches import statements and dynamic imports. Captures import specifiers only.
// Adapted from: https://github.com/vitejs/vite/blob/97f8b4df3c9eb817ab2669e5c10b700802eec900/packages/vite/src/node/optimizer/scan.ts#L47-L48
const importsRE =
/(?<!\/\/.*)(?<=^|;|\*\/)\s*(?:import(?:[\w*{}\n\r\t, ]+from)?\s*("[^"]+"|'[^']+')\s*(?=$|;|\/\/|\/\*)|import\s*\(\s*("[^"]+"|'[^']+')\s*\))/gm;
/(?<!\/\/.*)(?<=^|;|\*\/)\s*(?:import(?!\s+type)(?:[\w*{}\n\r\t, ]+from)?\s*("[^"]+"|'[^']+')\s*(?=$|;|\/\/|\/\*)|import\s*\(\s*("[^"]+"|'[^']+')\s*\))/gm;

/**
* Scan a file's imports to detect which renderer it may need.
Expand Down

0 comments on commit 141c010

Please sign in to comment.