Skip to content
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

ng build --prod --aot minifies js files from assets folder #15423

Closed
quanterion opened this issue Aug 23, 2019 · 2 comments · Fixed by #15433
Closed

ng build --prod --aot minifies js files from assets folder #15423

quanterion opened this issue Aug 23, 2019 · 2 comments · Fixed by #15433
Labels
area: devkit/build-angular freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Milestone

Comments

@quanterion
Copy link

quanterion commented Aug 23, 2019

🐞 Bug report

Command (mark with an x)

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

Is this a regression?

Yes, the previous version in which this bug was not present was: (7.x)

Description

Terser minifies js files in assets. I think it should not transform assets files in any way.
It's so strange that even disabling
"optimization": false,
"buildOptimizer": false,
doesn't solve the problem and js assets still changing

🔬 Minimal Reproduction

ng new ang8
copy attached file to assets folder and run
ng build --prod --aot

here is repro: https://github.com/quanterion/cli-assets-bug
you can see that files https://github.com/quanterion/cli-assets-bug/blob/master/src/assets/draco_decoder.js and https://github.com/quanterion/cli-assets-bug/blob/master/dist/ang8/assets/draco_decoder.js are different.

You can see attached file from assets changed in dist folder
and by minifing it Terser breaks it unfortunately:(

draco_wasm_wrapper.zip

@quanterion
Copy link
Author

quanterion commented Aug 23, 2019

@filipesilva
Is there temporary workaround to disable file minification, like adding comment at the top of the file?

@quanterion quanterion changed the title ng build --prod --aot mangles js files from assets folder ng build --prod --aot minifies js files from assets folder Aug 23, 2019
clydin added a commit to clydin/angular-cli that referenced this issue Aug 24, 2019
@alan-agius4 alan-agius4 added area: devkit/build-angular freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix labels Aug 24, 2019
@ngbot ngbot bot modified the milestone: Backlog Aug 24, 2019
mgechev pushed a commit that referenced this issue Aug 26, 2019
…ets (#15433)

* fix(@angular-devkit/build-angular): identify asset emitted files

* fix(@angular-devkit/build-angular): skip downlevel processing of assets

Fixes #15423
mgechev pushed a commit that referenced this issue Aug 26, 2019
…ets (#15433)

* fix(@angular-devkit/build-angular): identify asset emitted files

* fix(@angular-devkit/build-angular): skip downlevel processing of assets

Fixes #15423
@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 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: devkit/build-angular freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants