2.0.3 • Published 2 years ago

@choseohwan/rollup-builder v2.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

@choseohwan/rollup-builder

rollup builder for rollup config easier

Install

npm

npm install @choseohwan/rollup-builder --save-dev

yarn

yarn add @choseohwan/rollup-builder -D

Usage

Overall usage example

rollup.config.js

import buildRollupOptions, {Input, OutputBuilder, Plugin, Plugins} from '@choseohwan/rollup-builder';
import cleaner from "rollup-plugin-cleaner";
import peerDepsExternal from "rollup-plugin-peer-deps-external";
// 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
});

// makes plugins object 
const cleanerPlugin = new Plugin(
    'rollup-builder-cleaner',
    cleaner,
    (output) => [
        {
            targets: [output.getOutputDir()]
        }
    ]
);

const peerDepsExternals = new Plugin(
    'rollup-plugin-peer-deps-external',
    peerDepsExternal,
    []
);

const plugins = new Plugins(
    cleanerPlugin,
    peerDepsExternals,
    // ...
);

// 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
);
2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.36

3 years ago

1.1.0-alpha-18.0

3 years ago

1.1.0-next.0

3 years ago

1.0.34-alpha-8.0

3 years ago

1.0.34-alpha-6.0

3 years ago

1.0.35-alpha-9.0

3 years ago

1.0.34

3 years ago

1.0.33

3 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.1.0-alpha-4.7

3 years ago

1.1.0-beta.7

3 years ago

1.0.30

3 years ago

1.0.29-next.14

3 years ago

1.0.29-next.16

3 years ago

1.0.29-next.15

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.29-next.4

3 years ago

1.0.29-beta.3

3 years ago

1.0.22

3 years ago

1.0.19

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago