Skip to content

Optimize dist/vendor in prod #1208

Closed

Description

@pierredewilde
  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.

Activity

  1. kylecordes commented on Jun 26, 2016

    @kylecordes

    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.

  2. filipesilva commented on Jul 28, 2016

    @filipesilva
    Contributor

    Closed as issue was made obsolete by #1455.

  3. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    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.

  4. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions