-
-
Notifications
You must be signed in to change notification settings - Fork 255
feat(@angular/*): use different main entry in production mode #986
base: master
Are you sure you want to change the base?
Conversation
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.
There was a problem hiding this 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": ".", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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": ".", |
There was a problem hiding this comment.
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": ".", |
There was a problem hiding this comment.
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": ".", |
There was a problem hiding this comment.
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": ".", |
There was a problem hiding this comment.
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": ".", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
""
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. |
Ok sure that is understandable. |
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.