4

I need to share a custom angular 2 module to other projects in my company.

For example:

@NgModule({
  declarations: [
    AppComponent,
    BannerInlineComponent,
    WelcomeComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class SpecialModule { }

Now, I want to use it in other projects using:

npm install my-special --save

And use:

import { SpecialModule } from 'my-special';
Ythalo Rossy
  • 481
  • 1
  • 4
  • 16

1 Answers1

0

I found one option using Yoeman generator for angular library:

generator-angular2-library

The generator creating a base of your module.

After this, I simulated the publication of my custom module in local NPM using:

Sinopia

Sinopia docker image

Ythalo Rossy
  • 481
  • 1
  • 4
  • 16