forked from effect-app/boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
105 lines (93 loc) · 2.75 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import process from "process"
import { fileURLToPath } from "url"
import fs from "fs"
import rootPj from "../package.json"
// use `pnpm effa link` in the root project
// `pnpm effa unlink` to revert
const a = fs.existsSync("../libs")
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const localLibs = a || !!(rootPj.resolutions as any)["effect-app"]
const b = a ? "../libs" : "../../../effect-app/libs"
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
typescript: {
tsConfig: { compilerOptions: { moduleResolution: "bundler" } },
},
sourcemap: {
server: true,
client: true,
},
alias: {
"#resources": fileURLToPath(
new URL("../api/src/resources", import.meta.url),
),
"#models": fileURLToPath(new URL("../api/src/models", import.meta.url)),
...(localLibs
? {
"effect-app": fileURLToPath(
new URL(b + "/packages/effect-app/src", import.meta.url),
),
"@effect-app/vue": fileURLToPath(
new URL(b + "/packages/vue/src", import.meta.url),
),
}
: {}),
},
build: {
transpile: ["vuetify"]
// workaround for commonjs/esm module prod issue
// https://github.com/nuxt/framework/issues/7698
.concat(
process.env["NODE_ENV"] === "production" ? ["vue-toastification"] : [],
),
},
runtimeConfig: {
basicAuthCredentials: "",
apiRoot: "http://127.0.0.1:3610",
public: {
telemetry:
fs.existsSync("../.telemetry-exporter-running") &&
fs.readFileSync("../.telemetry-exporter-running", "utf-8") === "true",
baseUrl: "http://localhost:4000",
feVersion: "-1",
env: process.env["ENV"] ?? "local-dev",
},
},
modules: ["@vueuse/nuxt", "@hebilicious/vue-query-nuxt"],
// app doesn't need SSR, but also it causes problems with linking schema package.
ssr: false,
vite: {
build: {
minify: "terser",
terserOptions: { keep_classnames: true },
sourcemap: true,
},
optimizeDeps: {
// noDiscovery: true, // this breaks; "validator/lib/isEmail.js" has no default export
include: [
"@mdi/js",
"@unhead/vue",
"reconnecting-eventsource",
"mitt",
"@tanstack/vue-query",
"effect-app/utils",
"@effect-app/vue/routeParams",
"@effect-app/vue/form",
],
},
plugins: process.env["CI"]
? [
// sentryVitePlugin({
// org: "???",
// project: "effect-app-boilerplate-api",
// authToken: "???",
// sourcemaps: {
// assets: "./.nuxt/dist/**",
// },
// debug: true,
// }),
]
: [],
},
compatibilityDate: "2024-09-04",
})