Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watching any file in kiln-plugins replaces /js/_kiln-plugins.js with the contents of that file #116

Open
rmfarrell opened this issue Jan 9, 2019 · 1 comment

Comments

@rmfarrell
Copy link
Contributor

rmfarrell commented Jan 9, 2019

This only occurs on watch. Build works fine, but I think the target file kiln-plugins, gets replaced on watch with the content of the file that is changed. I think the compiler needs to build from the entry point of _kiln-plugins.js

To reproduce:

  1. pull https://github.com/nymag/sites/pull/7240
  2. run npm run watch
  3. change any file under services/kiln/plugins/media-picker/**/*.vue
@yuliyv
Copy link
Contributor

yuliyv commented Jan 14, 2019

I think I've narrowed this down a little bit. In the scripts compilation command on watch we only pass a single entry point (the file that was just modified) which I think is then interpreted down stream as that being the only file which needs to be in the bundle. As a result whatever bundled file was getting changed will be overwritten with only the contents of the single entry and not respect anything that was previously cached.

There is a similar issue with the templates compilation command where any unmodified templates are filtered out before the bundles are written causing the same issue where bundles do not have their complete contents. This one is slightly trickier was we have no caching of template files during compilation so this one might be slightly harder to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants