UNPKG

1.17 kBMarkdownView Raw
1Sample projects structure
2```
3+-- dist // target folder
4+-- src
5| +-- package.json // module package.json
6angular-cli.json
7package.json // root package.json
8```
91. Safety: add `"private":true` to your root `package.json`
10
112. Module package.json (see sample project structure above) should contain dependencies and peerDepencies of module, sample:
12
13 ```json
14 {
15 "name": "ng2-bootstrap",
16 "dependencies": {
17 "moment": "*"
18 },
19 "peerDependencies": {
20 "@angular/common": "*",
21 "@angular/compiler": "*",
22 "@angular/core": "*",
23 "@angular/forms": "*"
24 }
25 }
26 ```
27
283. Module configuration: by default `ngm` reads `angular-cli.json` in projects root
29 ```json
30 {
31 "module":[{
32 "name": "ng2-bootstrap",
33 "root": "src",
34 "outDir": "dist",
35 "main":"index.ts",
36 "tsconfig": "tsconfig.json"
37 }]
38 }
39 ```
40
414. Running: just add `ngm` script to your root package.json (see sample project structure above)
42
43 ```json
44 "scripts": {
45 "build": "ngm"
46 }
47 ```
48
495. Ready steady go:
50 ```sh
51 npm run build
52 ```
53
546. Now you can go to `dist` folder and do `npm publish` (will be added as a command later)
55
\No newline at end of file