Our company is looking to incorporate Rollup with Angular 4/Typescript and NPM, and we have a specific set of requirements:
- Various teams develop JS libraries that need to be centralized, similar to a CDN
- These libraries are hosted at remote URLs and should not be stored locally within the application due to frequent changes
- The consumer (application) installs an npm package in order to utilize the library
- The locally installed npm package includes a Javascript facade file or bundle that links to the remote JS library
- The npm package also includes a Typescript definition file
- The objective is for the consumer to seamlessly use the library without needing to add a script tag with a URL
- The locally installed Javascript file can be bundled alongside the application code
- New versions of the library should ideally maintain backwards compatibility
What is the most effective method to achieve this using Typescript/Javascript/NPM/Rollup? We intend to utilize ES2015 syntax transpiled to commonJS syntax.