Luc*_*cas 8 deployment nuxt.js nuxtjs3
您好,我正在 Nuxt 上创建网站,并且我已经在 Nuxt 3 上创建了一个新应用程序。但是我在部署方面遇到了问题,“正常服务器”没有像 Nuxt 2.x 那样的“正常”构建。
我正在使用“Lamdba”预设。 https://v3.nuxtjs.org/docs/deployment/presets/lambda
// nuxt.config.ts
import { defineNuxtConfig } from 'nuxt3'
// https://v3.nuxtjs.org/docs/directory-structure/nuxt.config
export default defineNuxtConfig({
// Global page headers: https://go.nuxtjs.dev/config-head
nitro: {
preset: 'lambda'
},
head: {
title: 'Title',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }
],
link: [
{ rel: 'icon', type: 'image/png', href: '/favicon.png' }
],
script: [
{
type: 'text/javascript',
src: '/mana.js',
}
]
},
})Run Code Online (Sandbox Code Playgroud)
在 Nuxt 2.x 上我使用了这个:
// nuxt.config.js
export default {
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
ssr: false,
// Target: https://go.nuxtjs.dev/config-target
target: 'static'
}Run Code Online (Sandbox Code Playgroud)
我应该在 Nuxt 3 上使用什么配置才能在所有服务器的根目录下使用 index.html 文件进行“正常”导出?
Luc*_*cas -7
静态部署目前不适用于 Nuxt 3