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

Commit 8d2ddaa

Browse files
author
Thorn Walli
committed
fix(generate): ignore full-static end generate for init
1 parent cb49a0c commit 8d2ddaa

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

example/nuxt.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const isTest = process.env.NODE_ENV === 'test'
66
const DEFAULT_LANG = 'en'
77

88
module.exports = {
9+
target: 'static',
910

1011
dev: isDev,
1112

lib/module.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ module.exports = function (moduleOptions) {
147147
async function moduleSetup (moduleScope, options) {
148148
options.pageExtend = options.pageExtend || DEFAULT_PAGE_EXTEND
149149

150+
// // ignore last server generate
151+
if (moduleScope.nuxt.options.target === 'static' && moduleScope.nuxt.server && !moduleScope.nuxt.options.dev) {
152+
return
153+
}
154+
150155
registerHooks(moduleScope.nuxt)
151156

152157
const layout = await cacheLayout(moduleScope, options)

test/module.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ describe('module', () => {
44
let nuxt
55

66
beforeAll(async () => {
7-
({ nuxt } = (await generate(loadConfig(__dirname, '../../example'))))
7+
const overrides = {
8+
target: null
9+
};
10+
11+
({ nuxt } = (await generate(loadConfig(__dirname, '../../example', overrides, { merge: true }))))
812
await nuxt.listen(await generatePort(60000))
913
}, 80000)
1014

0 commit comments

Comments
 (0)