New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when i import the css file in less file, vite would throw error:no found file,but if i change the .css into .less would no error #3293
Comments
Bug in Vite Less Plugin. Need to enable the |
so what can i do to solve this problem? |
i think i add the config into vite.config.js then will solve
|
and i have a problem that why enable the relativeurls will make it work? |
Not sure if it's a less bug, but here's my guess:
Now we have |
so if use ./base.less, doesn't it equivalent to base.less ? |
Less is quite an old project. It can run in the browser and was originally designed to be used as a standalone tool. Compiled files are concatenated at most. So the default logic works well in the browser context. |
do you mean vite use less.js? not compile less file to css file? |
Of course vite needs to call the less.js API to compile a less file. I was just talking about why less equate |
and it seem work while I change the code
into
|
|
That's why this issue is identified as a bug… |
The documentation describes what the correct behavior should be and I'm here talking about why Vite failed to get the correct result. |
only enable the relativeUrls option can solve the problem, the other way not solve, so this should be the less bug? not the vite bug? |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
After further investigation, I think I got it wrong. And after a closer reading of the less documentation and source code, I think |
Describe the bug
when i import css file in the less file, it would throw the error
Reproduction
repoduction:
https://github.com/Jeromy-L/test-vite/tree/test2
branch :test2
System Info
Output of
npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers
:Used package manager:
Logs
The text was updated successfully, but these errors were encountered: