mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-13 09:33:54 +00:00
Merge pull request #1982 from clarkdo/with-feathers-fix
fix: with-feathers nuxt.build is not a function
This commit is contained in:
commit
3ece774164
@ -1,22 +1,23 @@
|
|||||||
const resolve = require('path').resolve;
|
const resolve = require('path').resolve
|
||||||
const Nuxt = require('nuxt');
|
const { Nuxt, Builder } = require('nuxt')
|
||||||
|
|
||||||
// Setup nuxt.js
|
// Setup nuxt.js
|
||||||
let config = {};
|
let config = {}
|
||||||
try {
|
try {
|
||||||
config = require('../../nuxt.config.js');
|
config = require('../../nuxt.config.js')
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
config.rootDir = resolve(__dirname, '..', '..');
|
config.rootDir = resolve(__dirname, '..', '..')
|
||||||
config.dev = process.env.NODE_ENV !== 'production';
|
config.dev = process.env.NODE_ENV !== 'production'
|
||||||
const nuxt = new Nuxt(config);
|
|
||||||
|
const nuxt = new Nuxt(config)
|
||||||
if (config.dev) {
|
if (config.dev) {
|
||||||
nuxt.build().then(() => {
|
const builder = new Builder(nuxt)
|
||||||
process.emit('nuxt:build:done');
|
builder.build()
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
process.nextTick(() => process.emit('nuxt:build:done'));
|
process.nextTick(() => process.emit('nuxt:build:done'))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add nuxt.js middleware
|
// Add nuxt.js middleware
|
||||||
module.exports = function (req, res) {
|
module.exports = function (req, res) {
|
||||||
nuxt.render(req, res);
|
nuxt.render(req, res)
|
||||||
};
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user