-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnuxt.config.ts
76 lines (64 loc) · 1.95 KB
/
nuxt.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import process from "node:process";
const cacheRoute = (maxAge: number) => {
// Don't cache endpoints during integration tests, so that tests are isolated.
// In end-to-end tests, this variable evaluates to "production" so long as Playwright is using
// a built version of the app rather than `npm run dev`.
return process.env.NODE_ENV === "test" ? {} : { cache: { maxAge } };
};
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
build: {
transpile: ["tslib"], // https://github.com/nuxt/nuxt/discussions/21533
},
devtools: {
enabled: true,
timeline: {
enabled: true,
},
},
debug: false,
features: { devLogs: true },
nitro: {
experimental: {
websocket: true,
},
routeRules: {
"/": { redirect: "/scenarios/new" },
"/api/versions": cacheRoute(60),
},
},
modules: [
"@nuxtjs/fontaine", // https://nuxt.com/docs/getting-started/styling#font-advanced-optimization
"@pinia/nuxt",
"@nuxt/test-utils/module", // https://nuxt.com/docs/getting-started/testing#setup
"@nuxt/eslint",
],
vite: {
css: {
preprocessorOptions: {
scss: {
api: "modern",
additionalData: '@use "~/assets/scss/_variables.scss" as *;', // Enables variables to be accessible in SFC styles. https://nuxt.com/docs/getting-started/styling#using-preprocessors
quietDeps: true,
},
},
},
resolve: {
dedupe: ["vue-router"], // https://github.com/nuxt/nuxt/issues/15434#issuecomment-1408651163
},
},
eslint: {
config: {
standalone: false, // https://github.com/antfu/eslint-config/issues/506#issuecomment-2173283141
},
},
runtimeConfig: {
rApiBase: "", // Overriden by environment variable NUXT_R_API_BASE
},
$test: {
runtimeConfig: {
rApiBase: "", // https://nuxt.com/docs/getting-started/testing#registerendpoint
},
},
compatibilityDate: "2024-12-11",
});