Skip to content

Commit

Permalink
fix: remove files from processor
Browse files Browse the repository at this point in the history
Fixes #462
  • Loading branch information
tivac committed Aug 1, 2018
1 parent 2162a06 commit 9704d94
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/svelte/src/markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ async function extractLink({ processor, content, filename, link }) {
// This looks weird, but it's to support multiple types of quotation marks
const href = link[1] || link[2] || link[3];

const external = slash(resolve(path.dirname(filename), href));
const external = resolve(path.dirname(filename), href);

// Remove any files that've already been encountered, they should be re-processed
if(external in processor.files) {
[ ...processor.dependents(external), external ].forEach((file) => processor.remove(file));
}

// Remove the <link> element from the component to avoid double-loading
content = content.replace(link[0], "");
Expand Down

0 comments on commit 9704d94

Please sign in to comment.