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
Compile all components to one JS file #2850
Comments
@danhalliday you need to chose one of the supported module formats (I would suggest System.register) when transpiling from TS->ES5 and then concatenate files. Some of the module transport formats are concatenation-friendly. You might want to look at the setup I've got in https://github.com/pkozlowski-opensource/ng2-play to see what I mean. There are some pointers to learning materials in the repo as well. We are going to have complete, step-by-step instructions in the future but there are few moving parts atm. I'm going to close this one since this is a general support question. We will have detailed instructions and this stuff is being worked on, but for now you need to do some digging / experimenting, I'm afraid, as many of the tools used are in the alpha / beta / pre-release state so there are many moving parts. |
You might also be interested by the following: I build in two steps: #1 transpiles TS to es5/commonjs and #2 bundles it all for production: https://github.com/dsebastien/midnightLightV2/blob/master/gulp/tasks/scripts-typescript.js I assume that when the final version of TypeScript 1.5 will be out I'll be able to switch to the System module format.. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm trying to work out how to compile all of my TypeScript components to one JavaScript file. My app will have 50-100 components, so it's obviously not feasible to load them individually using
System.import()
.Concatenating compiled JavaScript files doesn't work because of the duplicate code. Concatenating the TypeScript files almost works, except for all the duplicate
import
symbols.How to do this?
The text was updated successfully, but these errors were encountered: