Skip to content
Permalink
Browse files

fix: invalidate files when they're changed

  • Loading branch information...
tivac committed Jan 29, 2019
1 parent e9cfae9 commit cb34c0882d54b72d559a5b0a141cc1457e6b904e
Showing with 11 additions and 7 deletions.
  1. +3 −0 packages/rollup/rollup.js
  2. +8 −7 packages/svelte/svelte.js
@@ -68,6 +68,9 @@ module.exports = (opts) => {
`Any plugins defined during the "done" lifecycle won't run when "styleExport" is set!`
);
}

// Watch any files already in the procesor
Object.keys(processor.files).forEach((file) => this.addWatchFile(file));
},

watchChange(file) {
@@ -50,9 +50,13 @@ module.exports = (config = false) => {

if(style) {
log("extract <style>");

file = "<style>";


if(processor.has(filename)) {
processor.invalidate(filename);
}

result = await processor.string(
filename,
style[1]
@@ -102,11 +106,8 @@ module.exports = (config = false) => {

log("extract <link>", external);

// When cleaning remove any files that've already been encountered, they need to be re-processed
if(config.clean) {
if(external in processor.files) {
[ ...processor.dependents(external), external ].forEach((entry) => processor.remove(entry));
}
if(processor.has(external)) {
processor.invalidate(external);
}

// Process the file

0 comments on commit cb34c08

Please sign in to comment.
You can’t perform that action at this time.