From fdc0ffef8d2f3af4a82893788f5d203a93932e92 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 5 Mar 2021 11:13:35 +0000 Subject: [PATCH] fix(compat): enforce nuxt generate for static target (#148) --- packages/nitro/src/compat.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/nitro/src/compat.ts b/packages/nitro/src/compat.ts index da26023eae..7aa9a9f47c 100644 --- a/packages/nitro/src/compat.ts +++ b/packages/nitro/src/compat.ts @@ -9,6 +9,11 @@ import { resolveMiddleware } from './server/middleware' export default function nuxt2CompatModule () { const { nuxt } = this + // Ensure we're not just building with 'static' target + if (!nuxt.options.dev && nuxt.options.target === 'static' && !nuxt.options._export && !nuxt.options._legacyGenerate) { + throw new Error('[nitro] Please use `nuxt generate` for static target') + } + // Disable loading-screen nuxt.options.build.loadingScreen = false nuxt.options.build.indicator = false