-
-
Notifications
You must be signed in to change notification settings - Fork 608
test: failing test cases for inline syntax and modules: auto
#1273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
"button.modules.css!=!./index-loader-syntax-sass.css", | ||
".baz { | ||
width: 5px; | ||
}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note they aren't hashed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do not use index-loader-syntax-sass.modules.css
? Because request here is index-loader-syntax-sass.css
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that wouldn't illustrate the problem. css-loader only looks at the resourcePath, not the matchResource. My goal for using this syntax is as an alternative to virtual files. ideally i'd want this to work in the case where there is no resourcePath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g. having this button.module.scss!=!./base64-loader/index.js?[ident]
work, at least from what Tobias suggested in the other issue. adding a resource to the end is just a hack to get something working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can't do it, because button.module.scss
can be any format...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about button2.module.css?modules=true!=!./my-loader/!.button.js
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can implement modules
on own side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like reimplement it? I could do that, but it's a lot of work. The hope/goal was to use the users existing config. If we need to reimplement css-loader, I can avoid all of this and write the whole thing as a plugin probably but that's more config and more duplicated work. It also doesn't solve the problem for anyone else trying to use virtual modules in this way, like svelte
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the specific hard part of that plan is when there are things in front of css-loader:
button2.module.scss!=!./my-loader?modules=true!.button.js
resolves fully to:
css-loader!sass-loader!my-loader?modules!./button.js
my-loader
can't do modules at it's spot because Sass still needs to run. my loader also can't enable modules on the lower css-loader because it would change the option for all files. The only thing it can is something like: webpack/webpack#10350 which i say works great, but have since realized does not work well at scale for a few, hard to describe, reasons that causes styles to be included multiple times and out of order, due to module id
's being (correctly) different between the plain require and compiled requires
Array [ | ||
"button.module.scss!=!./base64-loader/index.js?[ident]!./simple.js", | ||
".foo { | ||
color: red; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Codecov Report
@@ Coverage Diff @@
## master #1273 +/- ##
==========================================
- Coverage 99.46% 99.20% -0.27%
==========================================
Files 11 11
Lines 752 752
Branches 256 256
==========================================
- Hits 748 746 -2
- Misses 4 6 +2
Continue to review full report at Codecov.
|
This PR contains a:
Motivation / Use-Case
Breaking Changes
Additional Info