-
Notifications
You must be signed in to change notification settings - Fork 492
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
Compiling multiple typescript files #83
Comments
@series0ne Rollup does the job of bundling for the starter kit, so whatever folder structure you have, it produces just one bundle. For it all to work, you need to export each of your classes, then have one file with the same name as the project that exports all of them. For example, with two exported classes, export { HelloWorld } from './hello/hello-world';
export { ItalianHelloWorld } from './hello/italian-hello-world'; Then rollup produces one js file with the two classes and has this at the bottom: Hope this helps! |
@tonysneed said it clearly, that's the way to go for lib/app dev |
I have a naive followup question - what's the point of the bundler when working on libraries? Isn't it something that only the "end-product" needs to do, e.g. a web-app that must be deployed? My current requirements are to have maybe 5-10 classes in a library. I simply use |
There are several ways a lib can be used, and having a bundled one-file app in UMD format works universally, and needed for example if you use the lib from a CDN. |
@alexjoverm, makes sense. Thanks for the clarification. |
This starter works great when your library has only one TypeScript file, but not to well it you have > 1 file. Would it be possible to configure the build process to build everything in a folder rather than a single? file
Source...
...should produce...
The text was updated successfully, but these errors were encountered: