lhapaipai / symfony-vite-dev

Monorepo for symfony-vite development
https://symfony-vite.pentatrion.com
Other
26 stars 22 forks source link

Using vitest >= v1.5.1 causes `dummy-non-existing-folder` to be created when used with `--ui` #32

Closed thor-juhasz closed 2 months ago

thor-juhasz commented 3 months ago

vite-plugin-symfony version

6.4.7

vite-bundle version

6.4.7

your OS, node version, Symfony version, PHP version

Ubuntu 20.04, node 20.15.0, Symfony 6.4, PHP 8.2

Description

In our Symfony/Vite project we also use vitest. Vitest is sharing the vite.config.ts file. When running vitest --ui this causes a folder named dummy-non-existing-folder to be created in the root of the project, it contains .vite/entrypoints.json.

How to reproduce

Create a fresh vite project, yarn create vite, then yarn add -D vitest @vitest/ui vite-plugin-symfony. Create a minimalistic vite config loading the plugin, then run yarn run vitest --ui.

You will see that dummy-non-existing-folder/.vite/entrypoints.json was created. If you remove the newly created folder, then comment out the plugin loading in the vite config and re-run, you will see the folder is not created.

Possible Solution

No response

lhapaipai commented 2 months ago

hi @thor-juhasz, thank you for your time. it seems that Vitest overwrite some vite configuration when executed. https://github.com/vitest-dev/vitest/blob/8ff63560591c5dbdcb58950856df0c667f6bf744/packages/vitest/src/node/plugins/index.ts#L110

fixed with vite-plugin-symfony v6.5.2