Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

feat(@angular/*): use different main entry in production mode #986

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frederikschubert
Copy link
Contributor

When setting production to true, the main entry is set to the index.js file.
The file (like the other files in the src directory) is an ES5 JavaScript file
with ES6 module format. Using this file instead of the UMD bundle allows
for tree-shaking when building the package in production mode using
rollup.

When setting production to true, the main entry is set to the index.js file.
The file (like the other files in the src directory) is an ES5 JavaScript file
with ES6 module format. Using this file instead of the UMD bundle allows
for tree-shaking when building the package in production mode using
rollup.
Copy link
Member

@guybedford guybedford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks this looks good and will be great for other users.

The nice thing as well is that it will affect jspm 0.17 users only, so we don't need to worry too much about breaking workflows for jspm 0.16.

Why not have this configuration apply for both production and development? I know transpilation would slow down development, but that's just the way things go when working with es modules.

Also just to be sure, have you tested these overrides against jspm 0.16 to ensure there is no interference at all?

"deps": [
"reflect-metadata",
"zone.js"
]
}
},
"map": {
"@angular/compiler": ".",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why this is removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why it was there in the first place. I tested this config only with jspm@0.17 and it worked well. I can add it back if it is needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, if you're sure, you just included this before.

"deps": [
"reflect-metadata",
"zone.js"
]
}
},
"map": {
"@angular/core": ".",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

""

"deps": [
"reflect-metadata",
"zone.js"
]
}
},
"map": {
"@angular/http": ".",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

""

"deps": [
"reflect-metadata",
"zone.js"
]
}
},
"map": {
"@angular/platform-browser-dynamic": ".",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

""

"deps": [
"reflect-metadata",
"zone.js"
]
}
},
"map": {
"@angular/platform-browser": ".",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

""

"deps": [
"reflect-metadata",
"zone.js"
]
}
},
"map": {
"@angular/router": ".",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

""

@frederikschubert
Copy link
Contributor Author

I will try to test it with a 0.16 project. The speedup during development comes from the fact that only one UMD has to be loaded and not ~800 files so the transpilation is not the bottleneck.
It is almost impossible to test angular applications without the bundle on IE which loads only 2 files in parallel...

@guybedford
Copy link
Member

Ok sure that is understandable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants