From cd414102bc503e74b9e17ad3b62e14f7dd33a18a Mon Sep 17 00:00:00 2001 From: Raymon Ohmori Date: Thu, 22 Oct 2020 13:04:56 -0400 Subject: [PATCH] feat: add watchers to imports within vue files (#385) the watcher should rebuild vue files when the file's imports are updated Co-authored-by: Rahul Kadyan --- src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.ts b/src/index.ts index 5fd018b..7c67020 100644 --- a/src/index.ts +++ b/src/index.ts @@ -143,6 +143,10 @@ export default function PluginVue(userOptions: Partial = {}): Plugin { const descriptor = getDescriptor(query.filename) const hasScoped = descriptor.styles.some((s) => s.scoped) + if (query.src) { + this.addWatchFile(query.filename); + } + if (query.type === 'template') { debug(`transform(${id})`) const block = descriptor.template!