S
SolidJS9mo ago
Basil

`vite-plugin-solid` makes Vitest take over twice as long to run

I have over a hundred test files, and they take around 8 seconds to run. Adding the vite-plugin-solid Vite plugin to the Vitest config makes it take around 18 seconds to run, despite the majority of the tests being .test.ts files and having no components (there are only two very small .test.tsx files). It slows down the execution of all other tests, even though the only usage of Solid is a return createMutable(this) at the end of the constructor of every class. The exclude option does not seem to help. My Vitest config:
import { defineConfig } from 'vitest/config';
import tsconfigPaths from 'vite-tsconfig-paths';

export default defineConfig({
test: {
server: {
deps: {
// This fixes tests with components for some reason
inline: ['@basil/phosphor-solid'],
},
},
},
plugins: [tsconfigPaths()],
});
import { defineConfig } from 'vitest/config';
import tsconfigPaths from 'vite-tsconfig-paths';

export default defineConfig({
test: {
server: {
deps: {
// This fixes tests with components for some reason
inline: ['@basil/phosphor-solid'],
},
},
},
plugins: [tsconfigPaths()],
});
1 Reply
cirilla
cirilla9mo ago
There's a step where it goes through you dependencies and checks for a solid export field, which seems like it could take some time https://github.com/solidjs/vite-plugin-solid/blob/873f4cec4db1dcffac9d909191cf828a9902a418/src/index.ts#L195 Perhaps try editing the files for vite-plugin-solid in your node_modules to time it
Want results from more Discord servers?
Add your server