fix: Allow stylesheets to be bundled in storybook production build#473
Merged
frankieyan merged 2 commits intodevfrom Mar 18, 2021
Merged
fix: Allow stylesheets to be bundled in storybook production build#473frankieyan merged 2 commits intodevfrom
frankieyan merged 2 commits intodevfrom
Conversation
henningmu
approved these changes
Mar 18, 2021
Contributor
henningmu
left a comment
There was a problem hiding this comment.
Great going for the root cause – works like a charm 👏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short description
Fixes Storybook's production build so that stylesheets are included again.
This one has actually been lingering around since v6.0.0 - because we declared our package as side-effect-free (and later having declared CSS files being the only side-effects), Webpack drops our *.less imports from the production build as we simply import them, rather than passing their reference around as we do with CSS modules.
See https://webpack.js.org/configuration/module/#rulesideeffects and https://webpack.js.org/guides/tree-shaking for more details.
Since we don't expose any *.less files in the tsdx bundles, we should leave package.json as is and only declare this with Storybook's Webpack config.
Test plan
PR Checklist
npm run validateand made sure no errors / warnings were shownCHANGELOG.mdpackage.jsonandpackage-lock.json(npm --no-git-tag-version version <major|minor|patch>) refnpm run build-all)Versioning
No need for a release here