🚨(build) fix Vite CJS config warning

Since the migration to Vite 5 we had the "The CJS build of Vite's
Node API is deprecated" error ocurring during compilation.

We needed to rename to .mts the vite config file in order for it
to acknowledge that we are using the Node ESM API, this is needed
because we do not set "type": "module" in package.json because
we need to support CJS too.
This commit is contained in:
Nathan Vasse
2023-11-22 17:29:53 +01:00
committed by NathanVss
parent b2866c1d2b
commit 7201409d00
2 changed files with 4 additions and 3 deletions

View File

@@ -5,5 +5,7 @@
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
"include": [
"vite.config.mts"
]
}

View File

@@ -1,9 +1,8 @@
import { resolve } from "path";
import { defineConfig } from "vitest/config";
import { defineConfig, BuildOptions } from "vite";
import react from "@vitejs/plugin-react";
import dts from "vite-plugin-dts";
import tsconfigPaths from "vite-tsconfig-paths";
import { BuildOptions } from "vite";
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {