-
Notifications
You must be signed in to change notification settings - Fork 12
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
hacky changes to allow easier vue plugin development in nymag/sites #202
base: master
Are you sure you want to change the base?
Conversation
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.css
andjs/_kiln-plugins.js
will be not be completely compiled, often containing the assets for the.vue
file 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-dev
branch into/docker/repos
of your local sites directory. note, you may want to adddocker-compose.yml
to .git/info/exclude to prevent your changes from getting committeddocker exec -it sites_app_1 bash
and runnpm rebuild node-sass
make assets
and 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 master
in/docker/repos/claycli
.