[Question]Will Webpack support CSS module scripts?
See original GitHub issueIt seems that Chrome implements CSS module scripts
which imports CSS using import assertion.
https://web.dev/css-module-scripts/
import sheet from './styles.css' assert { type: 'css' };
document.adoptedStyleSheets = [sheet];
shadowRoot.adoptedStyleSheets = [sheet];
This seems to have different specifications than when using css-loader.
I’m wondering if I need to be aware of the difference between css-loader and CSS module scripts
in the future.
// CSS module scripts
import sheet from './styles.css' assert { type: 'css' };
// with css-loader
import sheet from './styles.css';
Are there any plans to support this on the Webpack side? Is this a problem that another library should address?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:17 (13 by maintainers)
Top Results From Across the Web
css-loader | webpack - JS.ORG
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >How to configure CSS Modules for webpack - LogRocket Blog
Increase the flexibility of your app's CSS components with CSS Modules and Webpack in this handy tutorial and demo app build.
Read more >似て非なるCSS Module Scripts - Zenn
[Question]Will Webpack support CSS module scripts? · Issue #14063 · webpack/webpack. It seems that Chrome implements CSS module scripts ...
Read more >How to configure CSS and CSS modules in webpack
Before we configure CSS support in the webpack setup, let's first add a CSS file and use it. The first thing we are...
Read more >How to use CSS Modules with TypeScript and webpack
Using CSS Modules with TypeScript is not as obvious as with JavaScript. There are several ways to do that.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@AkifumiSato Not fully finished
assert
handling is already in the core. You can do that:Assuming css-loader supports exportStylesheet, which it currently don’t