Avoid ts warnings in vite build

This commit is contained in:
Jordan Eldredge 2025-07-05 16:16:48 -07:00
parent b230cc66c5
commit 7b87c2302c

View file

@ -26,16 +26,17 @@ export function getPlugins({ minify, outputFile, vite }) {
// Needed for music-metadata-browser in the Webamp bundle which depends upon
// being able to use some polyfillable node APIs
nodePolyfills(),
typescript({
compilerOptions: {
jsx: "react-jsx",
module: "esnext",
declarationDir: vite ? "dist/demo-site/declarations" : undefined,
// Without this it complains that files will be overwritten, but I don't
// think this ever gets used...
outDir: vite ? undefined : "./tsBuilt",
},
}),
// Vite handles TypeScript natively, so only use the plugin for Rollup builds
vite
? null
: typescript({
compilerOptions: {
jsx: "react-jsx",
module: "esnext",
declarationDir: "dist/demo-site/declarations",
outDir: "./tsBuilt",
},
}),
// Enable importing .json files. But Vite already enables this, so enabling it there
// causes it to try to parse the js version as JSON.
vite ? null : json(),