Skip to content

Commit cb34c08

Browse files
committed
fix: invalidate files when they're changed
1 parent e9cfae9 commit cb34c08

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

packages/rollup/rollup.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ module.exports = (opts) => {
6868
`Any plugins defined during the "done" lifecycle won't run when "styleExport" is set!`
6969
);
7070
}
71+
72+
// Watch any files already in the procesor
73+
Object.keys(processor.files).forEach((file) => this.addWatchFile(file));
7174
},
7275

7376
watchChange(file) {

packages/svelte/svelte.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,13 @@ module.exports = (config = false) => {
5050

5151
if(style) {
5252
log("extract <style>");
53-
53+
5454
file = "<style>";
55-
55+
56+
if(processor.has(filename)) {
57+
processor.invalidate(filename);
58+
}
59+
5660
result = await processor.string(
5761
filename,
5862
style[1]
@@ -102,11 +106,8 @@ module.exports = (config = false) => {
102106

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

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

112113
// Process the file

0 commit comments

Comments
 (0)