Skip to content

Optimize dist/vendor in prod #1208

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
pierredewilde opened this issue Jun 26, 2016 · 3 comments · May be fixed by abhiit89/angular-cli#13, vutting4221/angular-cli#99 or dizzydaizy/angular-cli#206
Closed

Comments

@pierredewilde
Copy link

  1. OS?
Mac OS X El Capitan 10.11.5
  1. ng --version
angular-cli: 1.0.0-beta.8
node: 6.2.2
os: darwin x64
  1. Repro steps

ng build -prod creates bundle main.js containing minified angular 2 files.

Vendor files are stored unminified in dist/vendor directory :

$ tree dist/vendor
├── es6-shim
│   └── es6-shim.js
├── reflect-metadata
│   ├── Reflect.js
│   ├── Reflect.ts
│   ├── reflect-metadata.d.ts
│   ├── test
│   │   ├── harness.ts
│   │   ├── reflect
│   │   │   ├── reflect-decorate.ts
│   │   │   ├── reflect-definemetadata.ts
│   │   │   ├── reflect-deletemetadata.ts
│   │   │   ├── reflect-getmetadata.ts
│   │   │   ├── reflect-getmetadatakeys.ts
│   │   │   ├── reflect-getownmetadata.ts
│   │   │   ├── reflect-getownmetadatakeys.ts
│   │   │   ├── reflect-hasmetadata.ts
│   │   │   ├── reflect-hasownmetadata.ts
│   │   │   └── reflect-metadata.ts
│   │   ├── run.ts
│   │   └── spec.ts
│   ├── typings
│   │   └── node.d.ts
│   └── typings.d.ts
├── systemjs
│   └── dist
│       └── system.src.js
└── zone.js
    └── dist
        └── zone.js

Instead of those multiple unminified files, another bundle (eg vendors.js) may be used with minified versions of :

vendor/es6-shim/es6-shim.js
vendor/reflect-metadata/Reflect.js
vendor/systemjs/dist/system.src.js
vendor/zone.js/dist/zone.js

This should simplify and optimise the -prod distribution.

Of course, index.html should be also simplified to reflect this change.

@kylecordes
Copy link

I think there is other work coming to replace es6-shim and reflect-metadata with core-js. That will reduce the file count by one... of course more is also needed eventually. I wrote about some of this a while back in #987.

@filipesilva
Copy link
Contributor

Closed as issue was made obsolete by #1455.

@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
None yet
Projects
None yet
3 participants