Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit f0cb8d8

Browse files
committed
add preliminary folder structure
1 parent 336ba4a commit f0cb8d8

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed

public/docs/ts/latest/cookbook/third-party-lib.jade

+25-8
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ include ../_util-fns
4949
:marked
5050
## Library package format
5151

52-
In order to understand how to build and publish a library, you have to consider _how_ the library is going to be consumed.
52+
In order to understand how to build and publish a library, you have to consider _how_ the library
53+
is going to be consumed.
5354

5455
Some users need to add it as a `<script>` tag.
5556
Others might prefer to use a module loader like [SystemJS](https://github.com/systemjs/systemjs)
@@ -65,19 +66,35 @@ include ../_util-fns
6566

6667
You can configure `package.json` with more entry points besides [main](https://docs.npmjs.com/files/package.json#main).
6768

68-
The **Quickstart Library** seed uses a similar set of entry points as Angular itself,
69-
aimed at maximizing compatibility:
69+
The recommended set of entry points is as follows:
7070

7171
- `main` (default): an ES5 [UMD](https://github.com/umdjs/umd) bundle that can be consumed anywhere.
7272
- `module`: a flat ECMAScript module (FESM) bundle containing ES5 code.
7373
- `es2015`: a FESM containing ES2015 bundle.
7474
- `typings`: TypeScript and the AOT compiler will look at this entry for metadata.
7575

76-
code-example(language="json").
77-
"main": "./dist/angular-quickstart-lib.umd.js",
78-
"module": "./dist/angular-quickstart-lib.es5.js",
79-
"es2015": "./dist/angular-quickstart-lib.js",
80-
"typings": "./dist/angular-quickstart-lib.d.ts",
76+
A library should have the following file layout when published:
77+
78+
.filetree
79+
.file node_modules/library-name
80+
.children
81+
.file dist
82+
.children
83+
.file library-subfolders/...
84+
.file library-name.d.ts ('typings')
85+
.file library-name.es5.js ('module')
86+
.file library-name.js ('es2015')
87+
.file library-name.metadata.json
88+
.file library-name.umd.js ('main')
89+
.file library-name.umd.min.js
90+
.file index.d.ts
91+
.file module.d.ts
92+
.file LICENSE
93+
.file package.json
94+
.file README.md
95+
96+
97+
8198

8299
:marked
83100
There is also a minified UMD bundle (`angular-quickstart-lib.umd.min.js`) for smaller payloads

0 commit comments

Comments
 (0)