From e089ac649f513c14c4268d4cd75dbd5b2e219bbd Mon Sep 17 00:00:00 2001 From: Kevin Marrec Date: Fri, 24 Apr 2020 18:05:55 +0200 Subject: [PATCH] fix(vue-app): `sanitizeComponent` import regression with features disabled (#7271) --- packages/vue-app/template/App.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/vue-app/template/App.js b/packages/vue-app/template/App.js index ce304f644c..14f8a2a681 100644 --- a/packages/vue-app/template/App.js +++ b/packages/vue-app/template/App.js @@ -1,13 +1,16 @@ import Vue from 'vue' -<% if (features.asyncData || features.fetch) { %> -import { - getMatchedComponentsInstances, - getChildrenComponentInstancesUsingFetch, - promisify, - globalHandleError, - sanitizeComponent -} from './utils' -<% } %> +<% utilsImports = [ + ...(features.asyncData || features.fetch) ? [ + 'getMatchedComponentsInstances', + 'getChildrenComponentInstancesUsingFetch', + 'promisify', + 'globalHandleError' + ] : [], + ...features.layouts ? [ + 'sanitizeComponent' + ]: [] +] %> +<% if (utilsImports.length) { %>import { <%= utilsImports.join(', ') %> } from './utils'<% } %> <% if (features.layouts && components.ErrorPage) { %>import NuxtError from '<%= components.ErrorPage %>'<% } %> <% if (loading) { %>import NuxtLoading from '<%= (typeof loading === "string" ? loading : "./components/nuxt-loading.vue") %>'<% } %> <% if (buildIndicator) { %>import NuxtBuildIndicator from './components/nuxt-build-indicator'<% } %>