mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
Merge branch 'dev' of github.com:nuxt/nuxt.js into dev
This commit is contained in:
commit
9098854a30
@ -12,6 +12,11 @@ import App from '<%= appPath %>'
|
|||||||
|
|
||||||
import { getContext } from './utils'
|
import { getContext } from './utils'
|
||||||
|
|
||||||
|
// Import SSR plugins
|
||||||
|
<% plugins.forEach(function (plugin) { if (plugin.ssr)
|
||||||
|
{ %>import <%= plugin.name %> from '<%= r(plugin.src) %>'
|
||||||
|
<% }}) %>
|
||||||
|
|
||||||
// Component: <nuxt-child>
|
// Component: <nuxt-child>
|
||||||
Vue.component(NuxtChild.name, NuxtChild)
|
Vue.component(NuxtChild.name, NuxtChild)
|
||||||
// Component: <nuxt-link>
|
// Component: <nuxt-link>
|
||||||
@ -113,20 +118,18 @@ async function createApp (ssrContext) {
|
|||||||
delete ctx.redirect
|
delete ctx.redirect
|
||||||
delete ctx.error
|
delete ctx.error
|
||||||
|
|
||||||
// Includes & Inject external plugins
|
// Inject external plugins
|
||||||
<% plugins.forEach(function (plugin) {
|
<% plugins.forEach(function (plugin) {
|
||||||
if (plugin.ssr) { %>
|
if (plugin.ssr) { %>
|
||||||
let <%= plugin.name %> = require('<%= plugin.src %>')
|
|
||||||
<%= plugin.name %> = <%= plugin.name %>.default || <%= plugin.name %>
|
|
||||||
if (typeof <%= plugin.name %> === 'function') {
|
if (typeof <%= plugin.name %> === 'function') {
|
||||||
<%= plugin.name %>(ctx)
|
await <%= plugin.name %>(ctx)
|
||||||
}
|
}
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
if (process.browser) {
|
if (process.browser) {
|
||||||
let <%= plugin.name %> = require('<%= plugin.src %>')
|
let <%= plugin.name %> = require('<%= plugin.src %>')
|
||||||
<%= plugin.name %> = <%= plugin.name %>.default || <%= plugin.name %>
|
<%= plugin.name %> = <%= plugin.name %>.default || <%= plugin.name %>
|
||||||
if (typeof <%= plugin.name %> === 'function') {
|
if (typeof <%= plugin.name %> === 'function') {
|
||||||
<%= plugin.name %>(ctx)
|
await <%= plugin.name %>(ctx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<% }
|
<% }
|
||||||
|
Loading…
Reference in New Issue
Block a user