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.
This PR contains a:
Motivation / Use-Case
webpack/webpack#14063
Example usage:
Breaking Changes
No
Additional Info
Here some questions/notes:
@import
? We can do it (because we bundle), but chrome doesn't support yet, let's keep them as is and emit an errorexportType: 'css-style-sheet'
will enablemodules.namedExport: true
by default, otherwise we need modifyCSSStyleSheet
interface, it is bad, so we emit errorFound artifacts in render for emoji (maybe bug in chrome, I will investigate)2
point, CSS modules andexportType: 'css-style-sheet'
can be used only for ECMA modules, without CSS modules you can use commonjs format (i.e.esModule: false
), but I recommend migrate onesModule
(true
by default)document.adoptedStyleSheets
, related Progress on Hot Module Replacement support? lit/lit#2007 (more links inside)mini-css-extract-plugin
requires more work, we will improve this in near futureexportType: 'css-steel-sheet'
you don't needstyle-loader
anymoreMigration usage:
Example: https://web.dev/css-module-scripts/
Additional: https://developers.google.com/web/updates/2019/02/constructable-stylesheets