@@ -28,6 +28,8 @@ include ../_util-fns
28
28
29
29
[Library package format](#library-package-format)
30
30
31
+ [Published file layout](#published-file-layout)
32
+
31
33
[Setup a local development environment](#setup-a-local-development-environment)
32
34
33
35
[What's in the QuickStart Library seed?](#what-s-in-the-quickstart-library-seed-)
@@ -57,7 +59,8 @@ include ../_util-fns
57
59
or the native Node one.
58
60
Bundlers, like [Webpack](https://webpack.js.org/) are very popular as well.
59
61
[Typescript](typescriptlang.org) users need type definitions.
60
- [Rollup](https://github.com/rollup/rollup) users make use of ECMAScript modules for tree-shaking.
62
+ [Rollup](https://github.com/rollup/rollup) users make use of ECMAScript Modules (ESM)
63
+ for tree-shaking.
61
64
Even though [Ahead-of-time](#appendix-supporting-aot) is preferred,
62
65
[Just-in-time](#appendix-supporting-jit) compilation should be supported.
63
66
@@ -69,13 +72,73 @@ include ../_util-fns
69
72
The recommended set of entry points is as follows:
70
73
71
74
- `main` (default): an ES5 [UMD](https://github.com/umdjs/umd) bundle that can be consumed anywhere.
72
- - `module`: a flat ECMAScript module (FESM ) bundle containing ES5 code.
73
- - `es2015`: a FESM containing ES2015 bundle.
75
+ - `module`: a flat ECMAScript Module (ESM ) bundle containing ES5 code.
76
+ - `es2015`: a flat ESM containing ES2015 bundle.
74
77
- `typings`: TypeScript and the AOT compiler will look at this entry for metadata.
75
78
76
79
In addition, a minimized version of the UMD bundle should also be provided, as well as full
77
80
sourcemaps (all the way back to the source) for all JS bundles.
78
81
82
+ This set of entry points satisfies the following consumers:
83
+
84
+ style td, th {vertical-align: top}
85
+ table( width ="100%" )
86
+ col( width ="40%" )
87
+ col( width ="20%" )
88
+ col( width ="40%" )
89
+ tr
90
+ th Consumer
91
+ th Module format
92
+ th Entry point resolves to
93
+ tr
94
+ td Webpack (es2015) / Closure Compiler
95
+ td ESM+ES2015
96
+ td
97
+ :marked
98
+ `angular-library-name.js`
99
+ tr
100
+ td Angular CLI / Webpack/ Rollup
101
+ td ESM+ES5
102
+ td
103
+ :marked
104
+ `angular-library-name.es5.js`
105
+ tr
106
+ td Plunker / Fiddle / ES5 / script tag
107
+ td UMD
108
+ td
109
+ :marked
110
+ Requires manual resolution to `bundles/angular-library-name.umd.js`/`bundles/angular-library-name.umd.min.js`
111
+ tr
112
+ td Node.js
113
+ td UMD
114
+ td
115
+ :marked
116
+ `bundles/angular-library-name.umd.js`
117
+ tr
118
+ td TypeScript
119
+ td ESM+*.d.ts
120
+ td
121
+ :marked
122
+ `angular-library-name.d.ts`
123
+ tr
124
+ td AOT compilation
125
+ td *.metadata.json
126
+ td
127
+ :marked
128
+ `angular-library-name.metadata.json`
129
+
130
+ .l-sub-section
131
+ :marked
132
+ A flat ECMAScript module (FESM) is a bundled ECMAScript module where all imports were followed
133
+ copied onto the same file file.
134
+ It always contains ES module import/export statements but can have different levels of ES code
135
+ inside.
136
+
137
+
138
+ .l-main-section
139
+ :marked
140
+ ## Published file layout
141
+
79
142
A library should have the following file layout when published:
80
143
81
144
.filetree
@@ -100,19 +163,6 @@ include ../_util-fns
100
163
.file README.md
101
164
102
165
103
- :marked
104
- There is also a minified UMD bundle (`angular-quickstart-lib.umd.min.js`) for smaller payloads
105
- in Plunkers and script tags.
106
-
107
-
108
- .l-sub-section
109
- :marked
110
- A flat ECMAScript module (FESM) is a bundled ECMAScript module where all imports were followed
111
- copied onto the same file file.
112
- It always contains ES module import/export statements but can have different levels of ES code
113
- inside.
114
-
115
-
116
166
.l-main-section
117
167
:marked
118
168
## The QuickStart Library seed
0 commit comments