Skip to content

"optimization" flag breaks CSS in production #12631

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
brandon-sigao opened this issue Oct 17, 2018 · 2 comments
Closed

"optimization" flag breaks CSS in production #12631

brandon-sigao opened this issue Oct 17, 2018 · 2 comments

Comments

@brandon-sigao
Copy link

brandon-sigao commented Oct 17, 2018

Bug Report or Feature Request (mark with an x)

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

Command (mark with an x)

- [ ] new
- [ x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

npm: v5.6.0
Angular CLI: 6.2.5
Node: 8.11.4
OS: win32 x64
Angular: 6.1.7

Repro steps

run: npm build --prod (with optimization enabled)
run: http-server -p 8080 -c-1 dist/projectName
test functionality: CSS styles appear to be missing and transitions no longer work properly

Desired functionality

CSS in development behaves the same as CSS in production

Mention any other details that might be useful

Below is the problem code:

-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
-webkit-transition: opacity 0.3s, -webkit-transform 0s 0.3s;
transition: opacity 0.3s, transform 0s 0.3s;

When "optimization" is set to true these lines (and possibly others I haven't yet found) seem to be changed. I'm also getting slight css errors in the library MDBootstrap although I haven't tried to pinpoint exactly which lines are breaking.

I've tried many combinations of extractCss, aot, and buildOptimizer flags and none seem to matter. The only thing that helps is turning "optimization" off.

Here are the problem styles rendered on the page when using ng serve
image

Here is the same section on the same element after using build prod
image

I know all the transition stuff doesn't make much sense without context (it doesn't WITH context either tbh) but the point is that my css is definitely different when using optimization.

@alan-agius4
Copy link
Collaborator

Duplicate of #12408

@alan-agius4 alan-agius4 marked this as a duplicate of #12408 Oct 18, 2018
@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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants