1 | import { nodeResolve } from '@rollup/plugin-node-resolve';
|
2 | import commonjs from '@rollup/plugin-commonjs';
|
3 | import eslint from '@rollup/plugin-eslint';
|
4 | import terser from '@rollup/plugin-terser';
|
5 | import babel from '@rollup/plugin-babel';
|
6 |
|
7 | const plugins = [
|
8 | eslint(),
|
9 | nodeResolve({
|
10 | mainFields: ['module', 'jsnext:main', 'main', 'browser'],
|
11 | preferBuiltins: false
|
12 | }),
|
13 | commonjs(),
|
14 | babel({ babelHelpers: 'runtime', skipPreflightCheck: true }),
|
15 | terser()
|
16 | ];
|
17 |
|
18 | export default [
|
19 | {
|
20 | input: 'src/index.js',
|
21 | output: [
|
22 | {
|
23 | file: 'dist/bellhop.js',
|
24 | format: 'es'
|
25 | }
|
26 | ],
|
27 | plugins: plugins
|
28 | },
|
29 | {
|
30 | input: 'src/index.js',
|
31 | output: [
|
32 | {
|
33 | file: 'dist/bellhop-umd.js',
|
34 | format: 'umd',
|
35 | name: 'window',
|
36 | extend: true,
|
37 | sourcemap: true
|
38 | }
|
39 | ],
|
40 | plugins: plugins,
|
41 | external: ['@babel/runtime']
|
42 | }
|
43 | ];
|