mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
Add transition hooks in nuxt.config.js
This commit is contained in:
parent
8f29fe6a54
commit
2d85b53266
@ -41,7 +41,7 @@ require('<%= pluginPath %>')
|
||||
// root instance
|
||||
// here we inject the router and store to all child components,
|
||||
// making them available everywhere as `this.$router` and `this.$store`.
|
||||
const defaultTransition = <%= JSON.stringify(transition) %>
|
||||
const defaultTransition = <%= serialize(transition) %>
|
||||
const app = {
|
||||
router,
|
||||
<%= (store ? 'store,' : '') %>
|
||||
|
@ -8,6 +8,7 @@ import fs from 'fs-extra'
|
||||
import hash from 'hash-sum'
|
||||
import pify from 'pify'
|
||||
import webpack from 'webpack'
|
||||
import serialize from 'serialize-javascript'
|
||||
import { createBundleRenderer } from 'vue-server-renderer'
|
||||
import { join, resolve, sep } from 'path'
|
||||
import clientWebpackConfig from './webpack/client.config.js'
|
||||
@ -199,7 +200,9 @@ function * generateRoutesAndFiles () {
|
||||
let moveTemplates = templatesFiles.map((file) => {
|
||||
return readFile(r(__dirname, 'app', file), 'utf8')
|
||||
.then((fileContent) => {
|
||||
const template = _.template(fileContent)
|
||||
const template = _.template(fileContent, {
|
||||
imports: { serialize }
|
||||
})
|
||||
const content = template(templateVars)
|
||||
return writeFile(r(this.dir, '.nuxt', file), content, 'utf8')
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user