diff --git a/packages/bridge/src/nitro.ts b/packages/bridge/src/nitro.ts index 97abf9fd6b..54a5598913 100644 --- a/packages/bridge/src/nitro.ts +++ b/packages/bridge/src/nitro.ts @@ -18,6 +18,7 @@ export function setupNitroBridge () { // Handle legacy property name `assetsPath` nuxt.options.app.buildAssetsDir = nuxt.options.app.buildAssetsDir || nuxt.options.app.assetsPath nuxt.options.app.assetsPath = nuxt.options.app.buildAssetsDir + nuxt.options.app.baseURL = (nuxt.options.app as any).basePath // Nitro expects app config on `config.app` rather than `config._app` nuxt.options.publicRuntimeConfig.app = nuxt.options.publicRuntimeConfig.app || {} Object.assign(nuxt.options.publicRuntimeConfig.app, nuxt.options.publicRuntimeConfig._app) diff --git a/packages/nitro/src/context.ts b/packages/nitro/src/context.ts index 9f2cbefedd..bb13c97f22 100644 --- a/packages/nitro/src/context.ts +++ b/packages/nitro/src/context.ts @@ -140,7 +140,7 @@ export function getNitroContext (nuxtOptions: NuxtOptions, input: NitroInput): N generateDir: nuxtOptions.generate.dir, publicDir: resolve(nuxtOptions.srcDir, nuxtOptions.dir.public || nuxtOptions.dir.static), serverDir: resolve(nuxtOptions.srcDir, (nuxtOptions.dir as any).server || 'server'), - baseURL: nuxtOptions.app.baseURL, + baseURL: nuxtOptions.app.baseURL || '/', buildAssetsDir: nuxtOptions.app.buildAssetsDir, isStatic: nuxtOptions.target === 'static' && !nuxtOptions.dev, fullStatic: nuxtOptions.target === 'static' && !nuxtOptions._legacyGenerate,