vite-plugin-solid
vite-plugin-solid copied to clipboard
Plugin does not support relative root setting of Vite
Due to passing root as is to createRequire this plugin does not support relative root, it throws error in this case:
TypeError [ERR_INVALID_ARG_VALUE]: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received 'packages/solid/package.json'
Would it be better to add some check for it and resolve relative paths?
When moving from:

And running `vite' i.e. yarn start I get:

I believe this is a similar issue.
It would seem simply removing the root: './', in the vite.congfig.js fixes the issue. Guessing this jives cause my config is in the same directory as my index.html file.
e.g. https://stackblitz.com/edit/solidjs-templates-fkxu6h?file=vite.config.js,package.json
It would seem simply removing the
root: './',in the vite.congfig.js fixes the issue. Guessing this jives cause my config is in the same directory as my index.html file.
But it's impossible to use this approach in monorepo with more than one package 🥲
I guess it depends upon the details, I am using this in a yarn workspace monorepo.