We want to use Rollup with Angular 4/Typescript and NPM We have the following requirement within our company:
- Certain teams create JS libraries which need to be centralized (like a CDN)
- These libraries are behind a remote URL and should not exist locally within the application (the reason is that those libraries change too often)
- The consumer of the library (application) installs a npm package to use the library
- The locally installed npm package contains a Javascript facade file or bundle which puts a remote link to the JS library existing behind a remote URL
- The npm package also contains a Typescript definition file
- The goal is that the consumer doesn't need to add a script tag with an URL (he shouldn't be aware of this)
- The locally installed Javascript file could be bundled together with the application code
- New versions of the library would be backwards compatible if possible
What is the best way to achieve this using Typescript/Javascript/NPM/Rollup? We would use ES2015 syntax transpiled to commonJS syntax.