You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To provide an easy to use, productive and dev friendly seed here are some suggested refactoring.
Each suggestion has an issue attached, this issue is used for managing the issues:
The end result of the package should contain 2 versions of the package
ES5 bundle, 1 file, UMD format
ES6 bundle, modular. (ESM)
The ES5 version will be used when importing the package, this is done by setting
"main": "path-to-es5-bundle.js`
in package.json
The ES6 version is a modular option that a developer need to opt-in to use, however it also plays a part in the ES5 UMD bundle.
When developing, user will usually:
import { Something } from 'my-lib'
The UMD bundle is used, it has no type information but the ES6 version does. The ES6 version comes with d.ts files and they are referenced inside package.json
"typings": "esm/index.d.ts",
The ES6 version also hold *.metadata.json files so it provides support for AoT compilation.
Since main property references the UMD bundle we use the module property to make sure ES6 module syntax code get the modular ES6 version and not the UMD bundle (so AoT can work)
The text was updated successfully, but these errors were encountered:
To provide an easy to use, productive and dev friendly seed here are some suggested refactoring.
Each suggestion has an issue attached, this issue is used for managing the issues:
Move to Webpack 2 (Move to Webpack 2 #6)
Add DEMO application (Add demo application parallel to lib #9)
Support AoT friendly package (Support AoT compilation #8)
Output a UMD bundle (Output UMD bundle #7)
Distributed package structure
The end result of the package should contain 2 versions of the package
The ES5 version will be used when importing the package, this is done by setting
in package.json
The ES6 version is a modular option that a developer need to opt-in to use, however it also plays a part in the ES5 UMD bundle.
When developing, user will usually:
The UMD bundle is used, it has no type information but the ES6 version does. The ES6 version comes with
d.ts
files and they are referenced inside package.jsonThe ES6 version also hold
*.metadata.json
files so it provides support for AoT compilation.Since
main
property references the UMD bundle we use themodule
property to make sure ES6 module syntax code get the modular ES6 version and not the UMD bundle (so AoT can work)The text was updated successfully, but these errors were encountered: