-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
47 lines (41 loc) · 1.16 KB
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import postcss from 'rollup-plugin-postcss';
import multiInput from 'rollup-plugin-multi-input';
import pkg from './package.json';
export default [
// Just for CommonJS (for Node) build.
// Instructions for publishing a beta version:
// npm version pre<major|minor|patch> --preid=beta (e.g. npm version preminor --preid=beta)
// npm version 2.0.0-beta.1
// npm publish --tag=beta --otp=000000
{
input: 'src/index.js',
external: [...Object.keys(pkg.dependencies), ...Object.keys(pkg.peerDependencies)],
output: { dir: pkg.main, format: 'cjs' },
plugins: [
postcss({
modules: true,
}),
babel(),
resolve(),
commonjs(),
],
},
// ES module (for bundlers) build
{
input: ['src/**/*.js'],
external: [...Object.keys(pkg.dependencies), ...Object.keys(pkg.peerDependencies)],
output: { dir: pkg.module, format: 'es' },
plugins: [
postcss({
modules: true,
}),
babel(),
resolve(),
commonjs(),
multiInput(),
],
},
];