Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fix(generate): ignore full-static end generate for init
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorn Walli committed Oct 13, 2020
1 parent cb49a0c commit 8d2ddaa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions example/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const isTest = process.env.NODE_ENV === 'test'
const DEFAULT_LANG = 'en'

module.exports = {
target: 'static',

dev: isDev,

Expand Down
5 changes: 5 additions & 0 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ module.exports = function (moduleOptions) {
async function moduleSetup (moduleScope, options) {
options.pageExtend = options.pageExtend || DEFAULT_PAGE_EXTEND

// // ignore last server generate
if (moduleScope.nuxt.options.target === 'static' && moduleScope.nuxt.server && !moduleScope.nuxt.options.dev) {
return
}

registerHooks(moduleScope.nuxt)

const layout = await cacheLayout(moduleScope, options)
Expand Down
6 changes: 5 additions & 1 deletion test/module.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ describe('module', () => {
let nuxt

beforeAll(async () => {
({ nuxt } = (await generate(loadConfig(__dirname, '../../example'))))
const overrides = {
target: null
};

({ nuxt } = (await generate(loadConfig(__dirname, '../../example', overrides, { merge: true }))))
await nuxt.listen(await generatePort(60000))
}, 80000)

Expand Down

0 comments on commit 8d2ddaa

Please sign in to comment.