Skip to content

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

@quanterion

Description

@quanterion

🐞 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions