William Grasel
main | browser | module | es2015 | |
---|---|---|---|---|
ES version | ES5 | ES5 | ES5 | ES2015 |
Module format | CJS | UMD | ESM | ESM |
webpack | ✔ | ✔ | ✔ | – |
Rollup | (✔) | (✔) | ✔ | – |
jspm | ✔ | – | – | – |
{
...
"main": "index.js",
...
}
{
...
"main": "index.js",
"browser": "bundles/index.umd.js",
...
}
{
...
"main": "index.js",
"browser": "bundles/index.umd.js",
"module": "module/index.js",
...
}
{
...
"main": "index.js",
"browser": "bundles/index.umd.js",
"module": "module/index.js",
"es2015": "es2015/index.js",
...
}
$ ng generate library my-lib
$ ng build my-lib
$ vue create my-lib
$ vue-cli-service build
--target lib --name my-lib
$ npm install -g nwb
$ nwb new react-component my-lib
$ npm run build