@common-web/rollup
v1.0.15
Published
Spend less time worrying about setting up plugins just to use latest ES6 or typescript features.
Downloads
139
Readme
Why ?
Spend less time worrying about setting up plugins just to use latest ES6 or typescript features.
Just install and use.
Getting started
- Install the pkg:
yarn:
yarn add @common-web/rollup -D
npm:
npm install @common-web/rollup --save-dev
- Add scripts to your package.json
scripts: {
"ts-check": "tsc --noEmit",
"build": "ts-check && rollup -c"
}
- Run the build
yarn run build
Base plugin support:
- eslint (see rollup-plugin-eslint for options)
- babel (see @common-web/babel pkg for a list default ready to use config)
- typescript (see @rollup/plugin-typescript for options)
Recommended Use
- Small packages, backend using latest ESnext / Typescript
Setting up
// rollup.config.js
import { getBaseRollupPlugins } from '@common-web/rollup';
const plugins = getBaseRollupPlugins({
// eslint: { baseConfig: require('./eslintrc.js') } if you are using `eslintrc.js`
}).conat([
// Include your own plugins to support other features
]);
export default {
input,
output,
plugins
}
for more configuration options visit rollup.
Custom Options
Ability to opt-out of default plugins:
// rollup.config.js
import { getBaseRollupPlugins } from '@common-web/rollup';
const plugins = getBaseRollupPlugins({
eslint: {
disabled: true
},
json: {
disabled: true
}
}).conat([
// Include your own plugins to support other features
]);
Examples
- Building small TS util lib common-web-rollup-example