Skip to content
This repository has been archived by the owner on May 1, 2022. It is now read-only.

Prevent external imports from triggering snowpack web_module regeneration #55

Merged
merged 1 commit into from
Feb 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,10 @@ async function checkForNewWebModules(
const importPath = transformedSource.substring(meta.s, meta.e);
const notRelative = !importPath.startsWith('.');
const notAbsolute = !importPath.startsWith('/');
const notHttp = !importPath.startsWith('http://');
const notHttps = !importPath.startsWith('https://');
// Must be a node_module that snowpack didn't see before
return notRelative && notAbsolute;
return notRelative && notAbsolute && notHttp && notHttps;
});

return foundMissingWebModule;
Expand Down