fix(vue-app): sanitizeComponent import regression with features disabled (#7271)

This commit is contained in:
Kevin Marrec 2020-04-24 18:05:55 +02:00 committed by GitHub
parent 1ce8041abe
commit e089ac649f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,13 +1,16 @@
import Vue from 'vue' import Vue from 'vue'
<% if (features.asyncData || features.fetch) { %> <% utilsImports = [
import { ...(features.asyncData || features.fetch) ? [
getMatchedComponentsInstances, 'getMatchedComponentsInstances',
getChildrenComponentInstancesUsingFetch, 'getChildrenComponentInstancesUsingFetch',
promisify, 'promisify',
globalHandleError, 'globalHandleError'
sanitizeComponent ] : [],
} from './utils' ...features.layouts ? [
<% } %> 'sanitizeComponent'
]: []
] %>
<% if (utilsImports.length) { %>import { <%= utilsImports.join(', ') %> } from './utils'<% } %>
<% if (features.layouts && components.ErrorPage) { %>import NuxtError from '<%= components.ErrorPage %>'<% } %> <% if (features.layouts && components.ErrorPage) { %>import NuxtError from '<%= components.ErrorPage %>'<% } %>
<% if (loading) { %>import NuxtLoading from '<%= (typeof loading === "string" ? loading : "./components/nuxt-loading.vue") %>'<% } %> <% if (loading) { %>import NuxtLoading from '<%= (typeof loading === "string" ? loading : "./components/nuxt-loading.vue") %>'<% } %>
<% if (buildIndicator) { %>import NuxtBuildIndicator from './components/nuxt-build-indicator'<% } %> <% if (buildIndicator) { %>import NuxtBuildIndicator from './components/nuxt-build-indicator'<% } %>