Skip to content

Using css-loader in 'main' #3617

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

Closed
bmitchenko opened this issue Dec 18, 2016 · 9 comments
Closed

Using css-loader in 'main' #3617

bmitchenko opened this issue Dec 18, 2016 · 9 comments
Labels
P5 The team acknowledges the request but does not plan to address it, it remains open for discussion

Comments

@bmitchenko
Copy link

Is there a reason why component styles and other styles in 'main' are not processed by css-loader?

Let's say I have component with ~15 icons. These are small in size and I want them to be encoded in BASE64. The only way to do it now is to move some component's css rules including 'background[-url]' to styles.scss. But it doesn't help me to make this component reusabe in future (I want to move some components to standalone npm package).

@indywill
Copy link

I'm new also, but I think what you want to do is add the stylesheet you want loaded to app.styles array in angular-cli.json in the project root. Note that the path is relative to the app root, so for instance, use "../node_modules/font-awesome/css/font-awesome.min.css",
if you want to add font-awesom from your node modules.

Hope this helps.

@filipesilva
Copy link
Contributor

This would be useful, yes.

Relevant to this is #3511, where we actually had css-loader for component styles but removed it to fix an issue.

Maybe we can look at re-adding it.

@filipesilva filipesilva added command: build P5 The team acknowledges the request but does not plan to address it, it remains open for discussion labels Dec 30, 2016
@filipesilva
Copy link
Contributor

Superseded by #4285

@asnowwolf
Copy link

@filipesilva I vote to css-loader too.
But if only add css-loader, the sourcemap of the component style will be lose, I submitted two PRs about this issue: #4491 and angular/angular#14175

@filipesilva
Copy link
Contributor

@asnowwolf your PR as is won't fix sourcemaps since your fix in angular/angular is not in. Can you resubmit your PR here after angular/angular#14175 is accepted?

@asnowwolf
Copy link

asnowwolf commented Feb 13, 2017

Ok, I will resubmit it after that. I've verified it with my patched version.

@filipesilva
Copy link
Contributor

I trust it works in your patched version, mind you. It's just that it might be merged in a different form (or not merged at all) and until then, the code in the CLI would not be verifiable.

@asnowwolf
Copy link

asnowwolf commented Feb 14, 2017 via email

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P5 The team acknowledges the request but does not plan to address it, it remains open for discussion
Projects
None yet
Development

No branches or pull requests

4 participants