@choseohwan/rollup-plugin-builder-base
Base plugins builder about @choseohwan/rollup-builder
Install
npm
npm install @choseohwan/rollup-plugin-builder-base @choseohwan/rollup-builder --save-dev
yarn
yarn add @choseohwan/rollup-plugin-builder-base @choseohwan/rollup-builder -D
Description
List of applied plugins
-
- A rollup plugin to clean directories before rebuilding.
-
rollup-plugin-peer-deps-external
- Automatically externalize
peerDependencies
in arollup
bundle.
- Automatically externalize
-
- A Rollup plugin which Converts .json files to ES6 modules.
-
- A Rollup plugin which locates modules using the Node resolution algorithm,
for using third party modules in node_modules.
- A Rollup plugin which locates modules using the Node resolution algorithm,
-
- Rollup plugin for typescript with compiler errors.
- Works with ttypescript and typescript-transform-paths.
-
- A Rollup plugin to convert CommonJS modules to ES6,
so they can be included in a Rollup bundle.
- A Rollup plugin to convert CommonJS modules to ES6,
-
- A Rollup plugin for seamless integration between Rollup and Babel.
- Works with @babel/plugin-transform-runtime for rollup library.
-
- Rollup plugin to minify generated es bundle. Uses terser under the hood.
Usage
Create rollup.config.js
and babel.config.js
in project root.
rollup.config.js
import buildRollupOptions, { Input, OutputBuilder } from '@choseohwan/rollup-builder';
import buildBasePlugins from "@choseohwan/rollup-plugin-builder-base";
// another imports...
// makes input object (rollup config's input option)
const input = new Input(
{
index: 'src/index.ts',
option: 'src/option/index.ts',
builder: 'src/builder/index.ts'
},
{
umd: 'src/index.ts'
}
);
// makes output builder
const outputBuilder = new OutputBuilder({
sourcemap: true
});
// create plugins object using @choseohwan/rollup-plugin-builder-base
const plugins = buildBasePlugins();
// make rollup options with options
export default buildRollupOptions(
input,
[
outputBuilder.buildES({
dir: 'dist/esm'
}),
outputBuilder.buildCJS({
dir: 'dist/cjs'
}),
outputBuilder.buildUMD('common', {
dir: 'dist/umd'
})
],
plugins
);
babel.config.js
module.exports = {
// babel setup config here...
}