fix(typing): augment node types (kinda)
do some finagling to shut typescript up about "staging" being an invalid value for `process.env.NODE_ENV`
This commit is contained in:
parent
f447c0f88f
commit
0898a622eb
1
index.d.ts
vendored
Normal file
1
index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
/// <reference types="typings/node-ext.d.ts">
|
@ -1,9 +1,10 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
import { IUser } from "@models/user";
|
||||
import { render } from "vue";
|
||||
import { rc } from "./lib/server/constants";
|
||||
import { defineNuxtConfig } from "nuxt/config";
|
||||
import { fileURLToPath } from "url";
|
||||
import { StorageMounts } from "nitropack";
|
||||
import { uri } from "./lib/dbconfig";
|
||||
|
||||
const cac = {
|
||||
isr: true,
|
||||
@ -141,7 +142,11 @@ export default defineNuxtConfig({
|
||||
runtimeConfig: rc,
|
||||
typescript: {
|
||||
tsConfig: {
|
||||
exclude: ["./.nuxt/types/auth.d.ts"],
|
||||
exclude: ["./.nuxt/types/auth.d.ts", "../**/node_modules/next/**/*.d.ts"],
|
||||
compilerOptions: {
|
||||
typeRoots: ["typings/**/*.d.ts"],
|
||||
types: ["typings/node-ext.d.ts"],
|
||||
},
|
||||
},
|
||||
},
|
||||
imports: {
|
||||
|
@ -8,6 +8,22 @@
|
||||
"noImplicitThis": false,
|
||||
"verbatimModuleSyntax": false,
|
||||
"forceConsistentCasingInFileNames": false,
|
||||
"allowSyntheticDefaultImports": true
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"types": [
|
||||
"./typings/fuck-you.ts",
|
||||
"./typings/*.d.ts"
|
||||
],
|
||||
"typeRoots": [
|
||||
"typings/**/*.d.ts",
|
||||
"typings"
|
||||
]
|
||||
},
|
||||
"exclude": [
|
||||
"**/node_modules/next/**/*.d.ts"
|
||||
],
|
||||
"include": [
|
||||
"typings/**/*.d.ts",
|
||||
"typings/node-ext.d.ts",
|
||||
"nuxt.config.ts"
|
||||
]
|
||||
}
|
||||
|
7
typings/node-ext.d.ts
vendored
Normal file
7
typings/node-ext.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
declare global {
|
||||
namespace NodeJS {
|
||||
interface ProcessEnv {
|
||||
NODE_ENV: ("development" | "staging" | "production" | "test") & (string & {});
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user