Quick introduction
# rollup.config.js
export default [
// browser-friendly UMD build
{
input: 'src/main.js',
output: {
name: 'my-package',
file: pkg.browser,
format: 'umd'
},
plugins: [
resolve(),
commonjs()
]
},
// CommonJS (for Node) and ES module (for bundlers) build.
{
input: 'src/main.js',
output: [
{ file: pkg.main, format: 'cjs' },
{ file: pkg.module, format: 'es' }
]
}
]
# package.json
{
"main": "dist/json-api-response-converter.js",
"module": "dist/json-api-response-converter.es.js",
"browser": "dist/json-api-response-converter.min.js",
"scripts": {
"build": "rollup -c"
}
}
"scripts": {
"prepublishOnly": "yarn build"
}
# .npmignore
jest.config.js
__tests__
.eslintrc.js
babel.config.js
.github
rollup.config.js
$ yarn login
$ yarn publish
$ yarn add my-awesome-package