sendou.ink/scripts/scanner/vite-node.config.ts
2026-08-07 20:47:19 +03:00

19 lines
560 B
TypeScript

/**
* Config for running the scanner scripts with vite-node. Deliberately minimal:
* the root vite.config.ts pre-bundles @techstark/opencv-js for the browser
* worker, and vite-node would resolve that browser prebundle (which
* crashes on __dirname in Node). Without the include, vite-node
* externalizes the dep to a plain require of the (patched) CJS bundle.
*/
import { defineConfig } from "vite";
export default defineConfig({
resolve: {
tsconfigPaths: true,
},
optimizeDeps: {
noDiscovery: true,
exclude: ["@techstark/opencv-js"],
},
});