-
Notifications
You must be signed in to change notification settings - Fork 13
hacky changes to allow easier vue plugin development in nymag/sites #202
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
base: master
Are you sure you want to change the base?
Conversation
| tasks = [scripts], | ||
| builders = _.map(tasks, (task) => task.build), | ||
| watchers = _.map(tasks, (task) => task.watch).concat([media.watch]), | ||
| watchers = _.map(tasks, (task) => task.watch), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this file, we're just stripping out all build tasks except for scripts, to make compilation as fast as possible for developers who are only touching .vue files
| glob.sync(layoutModelsGlob), | ||
| glob.sync(kilnPluginsGlob), | ||
| globFiles | ||
| bundleEntries = glob.sync(kilnPluginsGlob).concat( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
limiting script compilation to just kiln plugin files
| buildScripts(bundleOptions.cache.files, bundleOptions) | ||
| // limiting entrypoints to kiln directory files | ||
| let cacheFiles = bundleOptions.cache.files.filter(item => item.match(/\/kiln\//)); | ||
| buildScripts( cacheFiles, bundleOptions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something in array of browserify-cache files/entry-points was interfering with kiln-plugin compilation. filtering that set of entry-points to just /kiln/ directory files seems to resolve the issue
Vue plugin compilation is somewhat broken in nymag/sites, due to some aspect of our browserify cache implementation. When compiling assets with claycli, files such as
css/_kiln-plugins.cssandjs/_kiln-plugins.jswill be not be completely compiled, often containing the assets for the.vuefile that was most recently touched.The issue is also documented here.
This PR is not meant to be merged, but is intended to provide documentation and alternate workflow for developers who are touching kiln-plugin files often. Further discovery is needed to provide a more complete solution to the problem.
To make use of this hack in
nymag/sites, just do the following:claycli/vue-plugin-devbranch into/docker/reposof your local sites directory. note, you may want to adddocker-compose.ymlto .git/info/exclude to prevent your changes from getting committeddocker exec -it sites_app_1 bashand runnpm rebuild node-sassmake assetsand continue developing kiln plugins within sites without having to stop your server or manually rebuild assets!And to revert back to normal claycli asset compilation, you can either undo the changes above, or
checkout masterin/docker/repos/claycli.