hacky changes to allow easier vue plugin development in nymag/sites#202
Open
hacky changes to allow easier vue plugin development in nymag/sites#202
Conversation
reubenson
commented
Sep 2, 2021
| tasks = [scripts], | ||
| builders = _.map(tasks, (task) => task.build), | ||
| watchers = _.map(tasks, (task) => task.watch).concat([media.watch]), | ||
| watchers = _.map(tasks, (task) => task.watch), |
Author
There was a problem hiding this comment.
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
reubenson
commented
Sep 2, 2021
| glob.sync(layoutModelsGlob), | ||
| glob.sync(kilnPluginsGlob), | ||
| globFiles | ||
| bundleEntries = glob.sync(kilnPluginsGlob).concat( |
Author
There was a problem hiding this comment.
limiting script compilation to just kiln plugin files
reubenson
commented
Sep 2, 2021
| buildScripts(bundleOptions.cache.files, bundleOptions) | ||
| // limiting entrypoints to kiln directory files | ||
| let cacheFiles = bundleOptions.cache.files.filter(item => item.match(/\/kiln\//)); | ||
| buildScripts( cacheFiles, bundleOptions) |
Author
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.