-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
CSS is missed in transform
hook
#6421
Comments
I don't know the older version. but right now, if you put the // vite.config.js
export default defineConfig({
plugins: [
vue(),
sourceMapsPathChangerPlugin([
// Use "../../" instead of "../" if resources are in "assets/" directory
["../node_modules/", "node-modules:///"],
["../vite/", "node-modules:///vite/"],
["../src/", "source-maps:///"],
["../", "source-maps:///"],
]),
cssBundlePlugin({
overwriteBundle: "style.css",
importFromModule: true,
}),
],
server: {
open: `./`,
},
... more info about plugin API: https://vitejs.dev/guide/api-plugin.html |
Not solves. In this case (when I use it as a plugin of Vite ( In this case I receive the correct CSS in
However even with:
It does not work since in The expected CSS in
I have updated the example repo code. |
There are two bugs:
The first bug is new. |
The bug appeared with Vite 2.6.0. With "~2.5.10" it works OK. |
Indeed 2.6.0 seems to mess style processing (causing all sorts of strange style related issues). Had similar issues with Lit + imported SCSS + PostCSS + Tailwind project with Using I am too interested in what causes this. I have not yet found the breaking change. |
With the latest Vite (3.2.4) while this issue is still actual, I can handle CSS:
In this case it works with minor changes:
I use the plugin to generate such CSS: Because Vite.js still does not support SourceMaps for CSS. |
This comment was marked as spam.
This comment was marked as spam.
Plugin hooks like |
same issue. I had fixed it by delete |
Given that
, I'll close this issue as wontfix. |
Describe the bug
CSS is missed in
transform
hook now.code
argument oftransform(code, id)
hook contains only"export default ''"
string. There is no CSS.It worked before — with Vite 2.5.7.
For example, I was able to generate such style.css
With this plugin: (using), (plugin code)
For the reproduction uncomment these lines of the minimal reproduction repo
Reproduction
https://github.com/AlttiRi/serve-json-gz-length-test
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: