chore(nuxt): update nuxt config

enable nitro minification
This commit is contained in:
parent a6dd1002e2
commit 00e2457aab
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

@ -1,39 +1,105 @@
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
import { IUser } from "~/models/user";
import { defineNuxtModule } from "@nuxt/kit";
// import speedkitHydrate from "nuxt-speedkit/dist/runtime/hydrate.mjs";
export type SessionData = IUser;
const ct =
<T>() =>
<U extends T>(u: U) =>
u;
export default defineNuxtConfig({ export default defineNuxtConfig({
devtools: { enabled: true }, experimental: {
modules: [ watcher: "chokidar-granular",
'@ant-design-vue/nuxt', // noScripts: true,
'@sidebase/nuxt-auth', treeshakeClientOnly: false,
'@pinia/nuxt' },
], devtools: { enabled: false },
css: [ "~/public/fonts.css", "~/public/css/all.css" ], modules: [
auth: { "vue-recaptcha/nuxt",
provider: { "@ant-design-vue/nuxt",
type: "local" "@sidebase/nuxt-auth",
} "@pinia/nuxt",
}, "@vueuse/nuxt",
nitro: { // defineNuxtModule({
esbuild: { // async setup(options, nuxt) {
options: { // nuxt.hook("components:extend", (components) => {
minify: false // // console.log(components);
} // // components = components.map((a) => {
} // // return speedkitHydrate(() => import(a.filePath));
}, // // });
runtimeConfig: { // });
captchaSecret: process.env.CAPTCHASECRET, // },
database: { // }),
user: process.env.DBUSER, // "nuxt-speedkit",
password: process.env.DBPASS, ],
uri: `mongodb://${process.env.DB}` // speedkit: {
}, // disableNuxtFontaine: true,
jwt: process.env.JWT, // },
public: { css: ["~/public/fonts.css", "~/public/css/all.css"],
// apiBase: "/api" auth: {
} provider: {
}, type: "local",
devServer: { pages: {
port: 3000, login: "/login",
host: "127.0.0.1", },
url: "[::1]" token: {
} signInResponseTokenPointer: "/token",
}) type: "Bearer",
headerName: "Authorization",
maxAgeInSeconds: 168 * 24 * 60 * 60,
sameSiteAttribute: "lax",
},
sessionDataType: {} as { [Property in keyof IUser]: string },
endpoints: {
signUp: { path: "/register", method: "post" },
},
},
globalAppMiddleware: {
isEnabled: false,
},
},
nitro: {
esbuild: {
options: {
minify: true,
// sourceMap: false,
},
},
},
// routeRules: {
// "/**": {
// cache: {
// maxAge: 60,
// headersOnly: true,
// },
// // swr: 60 * 60,
// },
// },
// ssr: false,
runtimeConfig: {
captcha: {
secret: process.env.CAPTCHASECRET,
key: process.env.CAPTCHAKEY,
},
database: {
user: process.env.DBUSER,
password: process.env.DBPASS,
uri: `mongodb://${process.env.DB}`,
},
jwt: process.env.JWT,
public: {
recaptcha: {
v2SiteKey: process.env.CAPTCHAKEY,
},
// apiBase: "/api"
},
nodebb: {
masterToken: process.env.nbb_bearer,
},
},
// components: {
// transform: (str) =>
// },
});