Closed caseyjhol closed 2 years ago
For <link>
we have mini-css-extract-plugin
, also we have https://github.com/webpack-contrib/css-loader#exporttype ("string"), so css-loader return text CSS which can be used to using new URL("", import.meta.url)
and injected in document, extracting is out of scope style-loader
Thank you for pointing me to css-loader/exporttype.
You mention here to use asset modules, and that the documentation needs to be updated. It might be good to mention in the documentation that asset-modules cannot be used with linkTag
(as I wasn't expecting it necessary to use a deprecated plugin in order to achieve this).
@caseyjhol Yeah, PR welcome, it was described in some migration guide, but looks like we missed it here
Feature Proposal
Support using asset-modules with style-loader instead of having to use file-loader.
Feature Use Case
file-loader is deprecated, so it would be great to be able to use asset-modules instead alongside style-loader. However, this doesn't currently seem possible. A file is generated -- however, it is not a valid CSS file (it contains JavaScript). In addition, the file is not included on the page at runtime.
Example configuration:
Please paste the results of
npx webpack-cli info
here, and mention other relevant information