steveblue / angular2-rollup

CLI for bundling Angular with Rollup and Closure Compiler
121 stars 18 forks source link

How to include third party libraries? #17

Closed Ks89 closed 7 years ago

Ks89 commented 7 years ago

Hi! How can I include other libraries to this project?

I want to use this project as an official rollup example of a library that I published on npm, but I don't know how to include my library and other deps (like hammerjs, mousetrap and font-awesome) to this project, because I'm not a rollup expert.

Thank u.

steveblue commented 7 years ago

@Ks89

How that library is integrated with the build depends on a few factors:

NO: You must include the library globally via <head> or SystemJS. Examples of both are in /src/public/index.html

You can configure libraries to get copied into a folder in the build in build.config.js. You can see that some libraries are already configured here to get copied.


module.exports = {
    dep: {
        lib: [
            'core-js',
            'reflect-metadata',
            'zone.js',
            'systemjs',
            '@angular',
            'rxjs'
        ],
        src: './node_modules',
        dist: './build/lib'
    },```
steveblue commented 7 years ago

This information should probably be in the README.md

steveblue commented 7 years ago

Oh wait, this info is in the README. Closing.

Ks89 commented 7 years ago

thank u, i will try it