feat: add options.matchImportLoadersByOrigin#544
feat: add options.matchImportLoadersByOrigin#544delijah wants to merge 1 commit intowebpack:masterfrom
options.matchImportLoadersByOrigin#544Conversation
Codecov Report
@@ Coverage Diff @@
## master #544 +/- ##
==========================================
- Coverage 98.65% 98.13% -0.52%
==========================================
Files 10 10
Lines 371 375 +4
Branches 89 91 +2
==========================================
+ Hits 366 368 +2
- Misses 5 7 +2
Continue to review full report at Codecov.
|
options.matchImportLoadersByOrigin
|
@delijah Could we add a prop to |
|
@michael-ciniawsky should it be handled by |
|
ah, sorry, read it wrong. Actually |
|
@sullenor i think a lot of things are working somehow. But using the same loader (let's assume a loader rule created for handling css) for a completely different file type (let's assume sass) just feels wrong. I just tried to reconstruct those errors, but i was not able to. Seems like there was something changed since those issues were created. So no real problems, but i think this importLoaders config option still does make no sense. Why not just using standard webpack behaviour and use the defined loader rules from webpack.config? What do you think? |
|
entry.css @import './style.css';
.className { color: red; }after Without the const css = [
[module.id, css, map, ...] // @import
[module.id, css, map, ...] // entry.css
]Your change is to omit the prefix, but isn't that the default already ? I'm missing something here ? Please elaborate further on this :) |
|
@delijah Would this work, if |
alexander-akait
left a comment
There was a problem hiding this comment.
Also no new feature in current implementation, only bugfixes and perf.
See: #542 (comment)
See: #542 (comment)
What kind of change does this PR introduce?
This PR introduces a new config option called "matchImportLoadersByOrigin" config option. With this config option set to true, all imports (@import and composes) are resolved matching webpack loaders by it's origin instead of just using the same loader chain, that was used for it's containing file. importLoaders config option is not needed anymore, when using matchImportLoadersByOrigin.
#287 is closely related and probably even the more solid version, but without config option. I do not understand why this never has been merged since it would solve so many issues.
Did you add tests for your changes?
If it is needed, i can add tests. First of all i would like to see, if my changes make sense.
If relevant, did you update the README?
Yes.
Summary
This should resolve the following issues:
#286
#131
css-modules/css-modules#110
css-modules/css-modules#170
Does this PR introduce a breaking change?
No