diff --git a/dev/test-studio/package.json b/dev/test-studio/package.json index 0dc826ea993..8d443806e2d 100644 --- a/dev/test-studio/package.json +++ b/dev/test-studio/package.json @@ -65,7 +65,7 @@ "styled-components": "^6.1.11" }, "devDependencies": { - "@million/lint": "^1.0.14", + "@million/lint": "1.0.14", "babel-plugin-react-compiler": "19.0.0-beta-201e55d-20241215", "chokidar": "^3.6.0", "vite": "^5.4.11" diff --git a/dev/test-studio/sanity.cli.ts b/dev/test-studio/sanity.cli.ts index 20f596697ee..5e8b1869b32 100644 --- a/dev/test-studio/sanity.cli.ts +++ b/dev/test-studio/sanity.cli.ts @@ -31,6 +31,10 @@ export default defineCliConfig({ ? { target: '18', sources: (filename) => { + /** + * This is the default filter when `sources` is not defined. + * Since we're overriding it we have to ensure we don't accidentally try running the compiler on non-src files from npm. + */ if (filename.includes('node_modules')) { return false } @@ -47,6 +51,10 @@ export default defineCliConfig({ ...viteConfig, plugins: millionLintEnabled ? [ + /** + * We're doing a dynamic import here, instead of a static import, to avoid an issue where a WebSocket Server is created by Million for `vite dev` that isn't closed. + * Which leaves `sanity build` hanging, even if the plugin itself isn't actually used. + */ require('@million/lint').vite({ filter: { include: millionInclude, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e008371c295..c8fa4e5c95b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -611,7 +611,7 @@ importers: version: 6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1) devDependencies: '@million/lint': - specifier: ^1.0.14 + specifier: 1.0.14 version: 1.0.14(encoding@0.1.13)(rollup@4.28.1) babel-plugin-react-compiler: specifier: 19.0.0-beta-201e55d-20241215