Watching any file in kiln-plugins replaces /js/_kiln-plugins.js with the contents of that file
rmfarrell opened this issue · comments
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:
- pull https://github.com/nymag/sites/pull/7240
- run
npm run watch
- change any file under
services/kiln/plugins/media-picker/**/*.vue
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.