Comments (4)
The root cause is terser/html-minifier-terser#177.
As for this won't happen in Vite or webpack5 builder, is because html-minify options here will be merged with Rsbuild's default options(https://github.com/rspack-contrib/rsbuild-plugin-html-minifier-terser/blob/38897bccc4330f9191e5d7c9ea54f8e7f5f76015/src/index.ts#L56-L68), which enabled minifyCSS
and triggered the issue above.
To resolve the problem, we should simply align with webpack builder's config (https://github.com/storybookjs/storybook/blob/bbfdf5897e399f65368ca2ed14930b912e466a25/code/builders/builder-webpack5/src/preview/iframe-webpack.config.ts#L184-L189) strictly, stop from merging with the default options in rsbuild-plugin-html-minifier-terser.
from storybook-rsbuild.
Just updated to the 0.0.11 and confirmed it fixed this issue! Thank you so much for quick response and release 🙏
![image](https://private-user-images.githubusercontent.com/8681348/356092362-a12939a8-8b10-4d39-a314-64cec64bfc58.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4NzI2MTgsIm5iZiI6MTcyMzg3MjMxOCwicGF0aCI6Ii84NjgxMzQ4LzM1NjA5MjM2Mi1hMTI5MzlhOC04YjEwLTRkMzktYTMxNC02NGNlYzY0YmZjNTgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTdUMDUyNTE4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MWVhM2E5YTZhZGI2YTUyZGIzNmZmOTkwNzdjMDQ1MTdhOTU5YjU1Y2ZjYWYzNjBmMDhlNWVhYjkwMmQzMWU4OCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.KUkzCNkCWgowmmO0vQehHffqDP860PqGz5GyHfVAZic)
from storybook-rsbuild.
Could you provide a minimal reproduction. I tried to visit https://github.com/tounsoo/margin-ds, but it seems to be a private repository at the moment.
from storybook-rsbuild.
Confirmed. The code on the left side is the source code, the selector is nested in sb-errordisplay
, whereas in the right output, no parent selector anymore.
![image](https://private-user-images.githubusercontent.com/12322740/355912873-65153f0c-6486-471e-aa89-91aefe698ed0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM4NzI2MTgsIm5iZiI6MTcyMzg3MjMxOCwicGF0aCI6Ii8xMjMyMjc0MC8zNTU5MTI4NzMtNjUxNTNmMGMtNjQ4Ni00NzFlLWFhODktOTFhZWZlNjk4ZWQwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDA1MjUxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYyMmFmZGU5NDMxMTA0ZDk0NDg2NTJkNGRkMmNlYjM5YzQxZjEyNDhlY2RkYTIxZjlhNmQxODg3NGJiYWYzZGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.zITB2ufxZ4UqxF6QPQxIk6ncyBjN4B--nMKI-YQs13Q)
from storybook-rsbuild.
Related Issues (20)
- Not working on Linux HOT 2
- Support Nx HOT 2
- Support for React <18 HOT 5
- Broken with [email protected] HOT 11
- error binding.JsResolverFactory is not a constructor HOT 4
- Compilation error "JavaScript parsing error: Expected ';', got 'assert'" HOT 7
- Very long compilation time and error "Conflict: Multiple assets emit different content to the same filename iframe.html" when source.entry is set in rsbuild config HOT 19
- Error: [html-rspack-plugin]: Child compilation failed HOT 2
- `Conflict: Multiple assets emit different content to the same filename iframe.html` when using custom `source.entry` HOT 3
- Creating new stories and saving stories in UI is not currently supported? HOT 6
- compatibility with storybook-addon-manual-mocks HOT 9
- react-docgen-typescript support? HOT 1
- Cannot find module error with `stories: ['../**/*.stories.ts']`
- How to use rspack.config.js configuration? HOT 2
- Can't resolve deps with @rsbuild/core 1.0.1-beta.10 HOT 1
- `public/index.html` gets copied instead of the Storybook template when building HOT 6
- CSS imported assets are bundled twice HOT 3
- v0.0.12 breaks dev HOT 11
- Asset loading in CSS doesn't work in dev HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storybook-rsbuild.