Skip to content

Commit

Permalink
fix bad default import scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Feb 24, 2021
1 parent 5c268c3 commit 177c3a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snowpack/src/scan-imports.ts
Expand Up @@ -29,7 +29,7 @@ const ESM_IMPORT_REGEX = /import(?:["'\s]*([\w*${}\n\r\t, ]+)\s*from\s*)?\s*["']
const ESM_DYNAMIC_IMPORT_REGEX = /(?<!\.)\bimport\((?:['"].+['"]|`[^$]+`)\)/gm;
const HAS_NAMED_IMPORTS_REGEX = /^[\w\s\,]*\{(.*)\}/s;
const STRIP_AS = /\s+as\s+.*/; // for `import { foo as bar }`, strips “as bar”
const DEFAULT_IMPORT_REGEX = /import\s+(\w)+(,\s\{[\w\s]*\})?\s+from/s;
const DEFAULT_IMPORT_REGEX = /import\s+(\w)+(,\s\{[\w\s,]*\})?\s+from/s;

export async function getInstallTargets(
config: SnowpackConfig,
Expand Down

0 comments on commit 177c3a7

Please sign in to comment.