Skip to content

Angular CLI builds styles before replacing files #11504

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
a-bachelet opened this issue Jul 10, 2018 · 3 comments
Closed

Angular CLI builds styles before replacing files #11504

a-bachelet opened this issue Jul 10, 2018 · 3 comments
Labels

Comments

@a-bachelet
Copy link

a-bachelet commented Jul 10, 2018

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request

Area

- [X] devkit
- [ ] schematics

Versions

- Node: 10.3.0
- Npm: 6.1.0
- Angular CLI: 6.1.0-rc.0

Desired functionality

When i build a project with ng build specifying the desired configuration it replaces files as i want.

But in order to replace styles i put a file called theme.scss in global scss loaded files, then i replace it with

 { replace: "src/theme.scss", with: "src/theme2.scss" }

The file replacement works correctly and everywhere in my project when i call theme.scss i get theme2.scss response.

However if in a specific component style i use vars from theme.scss vars are not called from theme2 but always from theme.

I think the problem might be that angular is replacing my theme.scss after the compiling of all my component styles.

I think it is an issue because the default behaviour should be that any call to my theme.scss file should be replaced by a theme2.scss file call, even in specific components.

@Serrulien
Copy link

Serrulien commented Jul 10, 2018

Hi,
I can't tell if angular-cli builds styles before replacing files, but note that you currently can only replace .ts files at build-time. In the end, it won't work.
You can look at #11451 (comment) for more information

@filipesilva filipesilva added type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity3: broken labels Jul 26, 2018
@filipesilva
Copy link
Contributor

Closing in favor of #11451, will add a response there.

@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 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants