-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -333,7 +333,8 @@ function buildScripts(entries, options = {}) { | |
|
|
||
| // speed up full rebuilds for developers | ||
| if (!options.minify) { | ||
| browserifyCache(bundler, { cacheFile: browserifyCachePath }); | ||
| // something in this browserifyCache call seems to be breaking compilation of vue plugin assets | ||
| // browserifyCache(bundler, { cacheFile: browserifyCachePath }); | ||
| // note: this file is NOT written in production environments | ||
| } | ||
|
|
||
|
|
@@ -436,17 +437,18 @@ function buildScripts(entries, options = {}) { | |
| function compile(options = {}) { | ||
| const watch = options.watch || false, | ||
| minify = options.minify || variables.minify || false, | ||
| globs = options.globs || [], | ||
| // globs = options.globs || [], | ||
| globs = [], | ||
| reporter = options.reporter || 'pretty', | ||
| globFiles = globs.length ? _.flatten(_.map(globs, (g) => glob.sync(path.join(process.cwd(), g)))) : [], | ||
| // client.js, model.js, kiln plugins, and legacy global scripts are passed to megabundler | ||
| bundleEntries = glob.sync(componentClientsGlob).concat( | ||
| bundleEntries = glob.sync(kilnPluginsGlob).concat( | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. limiting script compilation to just kiln plugin files |
||
| glob.sync(componentModelsGlob), | ||
| glob.sync(componentKilnGlob), | ||
| glob.sync(layoutClientsGlob), | ||
| glob.sync(layoutModelsGlob), | ||
| glob.sync(kilnPluginsGlob), | ||
| globFiles | ||
| // glob.sync(layoutModelsGlob), | ||
| // glob.sync(kilnPluginsGlob), | ||
| // globFiles | ||
| ), | ||
| // options are set beforehand, so we can grab the cached files to watch afterwards | ||
| bundleOptions = { minify, legacyFiles: globFiles }, | ||
|
|
@@ -482,12 +484,16 @@ function compile(options = {}) { | |
| * would be removed from this deps file upon watch recompilation. | ||
| * @see https://github.com/clay/claycli/issues/116#issuecomment-454110714 | ||
| */ | ||
| 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. Choose a reason for hiding this commentThe 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 |
||
| .then(function (result) { | ||
| _.map(result, reporters.logAction(reporter, 'compile')); | ||
| }); | ||
| // and re-copy the _client-init.js if it has changed | ||
| copyClientInit(); | ||
|
|
||
| console.log('Recompilation in progress ...'); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
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.vuefiles