vue-meteor icon indicating copy to clipboard operation
vue-meteor copied to clipboard

Dependency manager doesn't watch dependences after Meteor is restarted

Open akanix42 opened this issue 7 years ago • 6 comments

If your .vue file pulls in other scss files, changing those files won't trigger a change in your file unless your file has been changed since you started running Meteor. For example, let's say I have a Foo.vue file like so:

<script lang="scss">
@import "./bar";
</script>

If I, after creating this file, make changes to the bar.scss file that is being imported, the dependency manager will cause Foo.vue to be updated as well. All good!

However, if I restart Meteor and make a change to bar.scss, Foo.vue will not be updated because the dependency manager doesn't reload the list of dependencies on startup. In order to update Foo.vue, I have to make some arbitrary change to the Foo.vue file. This becomes a big issue when you have a few base scss files that are being imported into nearly every component of your app.

akanix42 avatar Jan 09 '18 17:01 akanix42

Hum, this feature does exists, so this seems like a bug.

Akryum avatar Jan 09 '18 17:01 Akryum

@nathantreid have you found a way to solve the problem?

zwrqq2009 avatar Dec 21 '18 12:12 zwrqq2009

I guess it's because Meteor cache compilation. Is there a way to also cache other informations from build plugins (like the file dependencies here)? @mitar @benjamn

Akryum avatar Sep 03 '19 15:09 Akryum

I think so. I think there is some method on the plugin where you can return what to cache/watch. I think you can return from compileOneFile all the files which were a dependency for a given file?

I did something like that here: https://github.com/meteor/meteor/pull/9272

mitar avatar Sep 03 '19 17:09 mitar

I don't see anything on the PR

Akryum avatar Sep 03 '19 19:09 Akryum

I am just saying that I used that in compileOneFile method from the plugin. Maybe I am misunderstanding this issue? But this is how I informed Meteor what files to watch.

Reading through the issue again, I think I am adding noise. Please ignore.

mitar avatar Sep 03 '19 19:09 mitar