Skip to content

Add an option to remove reflect-metadata polyfills from prod bundle #6325

Closed
@IgorMinar

Description

@IgorMinar

Bug Report or Feature Request (mark with an x)

- [x] feature request

Versions.

@angular/cli: 1.0.3
node: 6.9.5
os: darwin x64
@angular/animations: 4.2.0-beta.1
@angular/common: 4.2.0-beta.1
@angular/compiler: 4.2.0-beta.1
@angular/core: 4.2.0-beta.1
@angular/forms: 4.2.0-beta.1
@angular/http: 4.2.0-beta.1
@angular/material: 2.0.0-beta.4
@angular/platform-browser: 4.2.0-beta.1
@angular/platform-browser-dynamic: 4.2.0-beta.1
@angular/platform-server: 4.2.0-beta.1
@angular/router: 4.2.0-beta.1
@angular/service-worker: 1.0.0-beta.13
@angular/cli: 1.0.3
@angular/compiler-cli: 4.2.0-beta.1

Desired functionality.

reflect-metadata is a sizible chunk of code that slows down the critical path in production mode. It's only needed in the JIT (dev) mode (however we want to drop the need for in from core as well).

Currently there is no way to include the polyfill only for dev bundles. I tried using environment.ts but that gets loaded too late after the reflect api is already used by the app code.

It would be great to have a way to either strip the polyfill or have an alternative entry path for production polyfills.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgenteffort2: medium (days)featureIssue that requests a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions