From 6308b0e8cd4f0292c32a7c134a7e9204ff6022e6 Mon Sep 17 00:00:00 2001 From: bengallienne Date: Sun, 10 Feb 2019 16:18:29 +0000 Subject: [PATCH 1/5] Change references to 'prefetch' plugin. I have edited the code examples to reference the plugin by the name 'prefetch-app', as this seems to be the correct name the webpack config requires from inspecting the generated config. I have tested and can confirm this works with the example that deletes the plugin altogether, but not the blacklisting example. --- docs/guide/html-and-static-assets.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/guide/html-and-static-assets.md b/docs/guide/html-and-static-assets.md index 9636445404..2a0adb88e7 100644 --- a/docs/guide/html-and-static-assets.md +++ b/docs/guide/html-and-static-assets.md @@ -37,7 +37,7 @@ The hints are injected using [@vue/preload-webpack-plugin](https://github.com/vu By default, a Vue CLI app will automatically generate prefetch hints for all JavaScript files generated for async chunks (as a result of [on-demand code splitting via dynamic `import()`](https://webpack.js.org/guides/code-splitting/#dynamic-imports)). -The hints are injected using [@vue/preload-webpack-plugin](https://github.com/vuejs/preload-webpack-plugin) and can be modified / deleted via `chainWebpack` as `config.plugin('prefetch')`. +The hints are injected using [@vue/preload-webpack-plugin](https://github.com/vuejs/preload-webpack-plugin) and can be modified / deleted via `chainWebpack` as `config.plugin('prefetch-app')`. Example: @@ -46,11 +46,11 @@ Example: module.exports = { chainWebpack: config => { // remove the prefetch plugin - config.plugins.delete('prefetch') + config.plugins.delete('prefetch-app') // or: // modify its options: - config.plugin('prefetch').tap(options => { + config.plugin('prefetch-app').tap(options => { options[0].fileBlacklist = options[0].fileBlacklist || [] options[0].fileBlacklist.push(/myasyncRoute(.)+?\.js$/) return options @@ -84,7 +84,7 @@ module.exports = { chainWebpack: config => { config.plugins.delete('html') config.plugins.delete('preload') - config.plugins.delete('prefetch') + config.plugins.delete('prefetch-app') } } ``` From f624e0bcbcfcdcc1eb34c230608f57a5db55b3dc Mon Sep 17 00:00:00 2001 From: bengallienne Date: Thu, 21 Feb 2019 08:29:04 +0000 Subject: [PATCH 2/5] Updated file to show standard plugin name again Updated file to show standard plugin name again, and a not for when used in multi-page setups --- docs/guide/html-and-static-assets.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/guide/html-and-static-assets.md b/docs/guide/html-and-static-assets.md index 2a0adb88e7..a2b1a2ec9e 100644 --- a/docs/guide/html-and-static-assets.md +++ b/docs/guide/html-and-static-assets.md @@ -37,7 +37,10 @@ The hints are injected using [@vue/preload-webpack-plugin](https://github.com/vu By default, a Vue CLI app will automatically generate prefetch hints for all JavaScript files generated for async chunks (as a result of [on-demand code splitting via dynamic `import()`](https://webpack.js.org/guides/code-splitting/#dynamic-imports)). -The hints are injected using [@vue/preload-webpack-plugin](https://github.com/vuejs/preload-webpack-plugin) and can be modified / deleted via `chainWebpack` as `config.plugin('prefetch-app')`. +The hints are injected using [@vue/preload-webpack-plugin](https://github.com/vuejs/preload-webpack-plugin) and can be modified / deleted via `chainWebpack` as `config.plugin('prefetch')`. + +### Note for multi page setups +When using a multipage setup, the plugin name above should be changed to match the structure 'prefetch-{pagename}', for example 'prefetch-app'. Example: @@ -46,11 +49,11 @@ Example: module.exports = { chainWebpack: config => { // remove the prefetch plugin - config.plugins.delete('prefetch-app') + config.plugins.delete('prefetch') // or: // modify its options: - config.plugin('prefetch-app').tap(options => { + config.plugin('prefetch').tap(options => { options[0].fileBlacklist = options[0].fileBlacklist || [] options[0].fileBlacklist.push(/myasyncRoute(.)+?\.js$/) return options @@ -84,7 +87,7 @@ module.exports = { chainWebpack: config => { config.plugins.delete('html') config.plugins.delete('preload') - config.plugins.delete('prefetch-app') + config.plugins.delete('prefetch') } } ``` From f57607d01815f925c53ce9050b7fc4239a7f54e8 Mon Sep 17 00:00:00 2001 From: bengallienne Date: Sat, 16 Mar 2019 21:02:15 +0000 Subject: [PATCH 3/5] Converted header to tip container As per request, changed to tip container markdown instead --- docs/guide/html-and-static-assets.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/guide/html-and-static-assets.md b/docs/guide/html-and-static-assets.md index a2b1a2ec9e..b54acbc8e9 100644 --- a/docs/guide/html-and-static-assets.md +++ b/docs/guide/html-and-static-assets.md @@ -39,8 +39,9 @@ By default, a Vue CLI app will automatically generate prefetch hints for all Jav The hints are injected using [@vue/preload-webpack-plugin](https://github.com/vuejs/preload-webpack-plugin) and can be modified / deleted via `chainWebpack` as `config.plugin('prefetch')`. -### Note for multi page setups +::: tip Note for multi page setups When using a multipage setup, the plugin name above should be changed to match the structure 'prefetch-{pagename}', for example 'prefetch-app'. +::: Example: From e16b66b0ead9ff96cb76aea2e740a25c35d2cee0 Mon Sep 17 00:00:00 2001 From: bengallienne Date: Sat, 16 Mar 2019 21:09:31 +0000 Subject: [PATCH 4/5] Slight reformat Added a line break to the tip markdown --- docs/guide/html-and-static-assets.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/guide/html-and-static-assets.md b/docs/guide/html-and-static-assets.md index b54acbc8e9..93d81f30c1 100644 --- a/docs/guide/html-and-static-assets.md +++ b/docs/guide/html-and-static-assets.md @@ -39,7 +39,8 @@ By default, a Vue CLI app will automatically generate prefetch hints for all Jav The hints are injected using [@vue/preload-webpack-plugin](https://github.com/vuejs/preload-webpack-plugin) and can be modified / deleted via `chainWebpack` as `config.plugin('prefetch')`. -::: tip Note for multi page setups +::: tip +Note for multi page setups When using a multipage setup, the plugin name above should be changed to match the structure 'prefetch-{pagename}', for example 'prefetch-app'. ::: From 154664e0372c97cf4cb0cdc882715686d042dea8 Mon Sep 17 00:00:00 2001 From: bengallienne Date: Mon, 18 Mar 2019 08:30:24 +0000 Subject: [PATCH 5/5] Fix position of tip title Changed to appear on the first line as requested --- docs/guide/html-and-static-assets.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/guide/html-and-static-assets.md b/docs/guide/html-and-static-assets.md index 93d81f30c1..b54acbc8e9 100644 --- a/docs/guide/html-and-static-assets.md +++ b/docs/guide/html-and-static-assets.md @@ -39,8 +39,7 @@ By default, a Vue CLI app will automatically generate prefetch hints for all Jav The hints are injected using [@vue/preload-webpack-plugin](https://github.com/vuejs/preload-webpack-plugin) and can be modified / deleted via `chainWebpack` as `config.plugin('prefetch')`. -::: tip -Note for multi page setups +::: tip Note for multi page setups When using a multipage setup, the plugin name above should be changed to match the structure 'prefetch-{pagename}', for example 'prefetch-app'. :::