Repository navigation
[wip] webpack5 ng css - #9434
Conversation
|
Nice! But I think this might match I think the "correct" config my be: On one of my projects I did this, but it might be a bit dirty: might need another include for node_modules on the |
| .rule('css') | ||
| .include.add(resolve(getEntryDirPath(), 'app.css')) | ||
| .add(resolve(getEntryDirPath(), `app.${platform}.css`)) | ||
| .add(/node_modules/); |
There was a problem hiding this comment.
@edusperoni This would I believe include all files in node_modules, since there's no extension checking.
There was a problem hiding this comment.
@rigor789 doesn't it extend from the base rule which does test for the extension?
There was a problem hiding this comment.
Ah you are right, for some reason I thought we had deleted the base rule.
|
@rigor789 how about my latest commit? Still have to test all scenarios out, but basically:
If a developer wants to load a css file normally ( config.rule('scss').include.add(pathToCssFile);
config.rule('scss|component').exclude.add(pathToCssFile);If they want to match a scss file somewhere else, they have to swap Considering Angular devs never import css manually, this should cover all bases. Thoughts? |
|
@edusperoni lgtm, though I would like to give this a spin in an app and see if everything works as expected. Could you run the tests & update the snapshots? ( |
|
I think this is should be ready for merge |
/cc @edusperoni