BoltDoggy / parcel-plugin-vue

⚠️ parcel-bundler/parcel @1.7.0 support Vue Now. This plugin will be not recommended.
https://github.com/parcel-bundler/parcel
209 stars 15 forks source link

Hot-reload/compile not working with single file components #18

Open breadadams opened 6 years ago

breadadams commented 6 years ago

Using a single file component, with src attributes on <template> & <style> eg.

SomeComponent.vue:

<template src="./button.html" />
<style lang="scss" scoped src="./button.scss" />

Changes made to either of those files respectivly, doesn't cause any recompiling of Parcel. I have to go into SomeComponent.vue and re-save that file for it to compile.

Software Version(s)
parcel-plugin-vue ^1.5.0
Parcel ^1.4.1
Vue ^2.5.13
Node 8.1.2
npm/Yarn 1.3.2 (Yarn)
Operating System MacOs Sierra (10.12.6)
resolritter commented 6 years ago

I investigated this quite a bit since yesterday as it is the same for LESS or any other included files.

The problem seems to happen because the referenced files aren't being recognized as implicit component dependencies in the assets pipeline, and thus do not trigger the parent's (Vue file) recompilation.

img

Luckily we have access to the delegate property (from the constructor's options) so it could probably be resolved without messing with Parcel's source code.

p2yang commented 6 years ago

Stylus has the same problem.