This repository has been archived by the owner on May 3, 2024. It is now read-only.
feat(styles-loader): aggregate stylesheets and dedupe if already loaded #1291
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.
Description
This change ports #1099 from one-app@6 to one-app@5.
Motivation and Context
This change is raised to support an existing one-app@6 feature in one-app@5. For the original motivation and context, please see the original PR (#1099).
How Has This Been Tested?
To test this change, I generated a root module and two child modules which all render on a single page. Within each module, I have installed a basic component library that imports a css module within the component:
Within each module, I've also created a
styles.module.css
with a class that changes the background color of the element it is applied to. This class has been applied to an instance of theButton
component from the component library listed above with the text "With Changes".Before this change, the response from the server would look like this (note the duplicated button class and the lack of style overrides on the root and child-a):
After this change, the response from the server looks like this (note the single button class and the style overrides across all modules):
Types of Changes
Checklist:
What is the Impact to Developers Using One App?
An existing feature on one-app@6 will be available to users still using one-app@5.