1 | import commonjs from 'rollup-plugin-commonjs';
|
2 | import nodeResolve from 'rollup-plugin-node-resolve';
|
3 | import babel from 'rollup-plugin-babel';
|
4 | import typescript from 'rollup-plugin-typescript2';
|
5 | import minify from 'rollup-plugin-babel-minify';
|
6 | import genHeader from './lib/header';
|
7 | import css from 'rollup-plugin-css-porter';
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | const plugins = {
|
13 | nodeResolve: nodeResolve({
|
14 | extensions: ['.ts', '.js', '.json']
|
15 | }),
|
16 | typescript: typescript({
|
17 | tsconfig: 'tsconfig.code.json'
|
18 | }),
|
19 | commonjs: commonjs(),
|
20 | babel: babel({
|
21 | extensions: ['.ts', '.js'],
|
22 | runtimeHelpers: true
|
23 | }),
|
24 | minify: minify({ comments: false }),
|
25 | cssRaw: css({
|
26 | raw: 'dist/vis-network.css',
|
27 | minified: false
|
28 | }),
|
29 | cssMin: css({
|
30 | raw: false,
|
31 | minified: 'dist/vis-network.min.css'
|
32 | })
|
33 | }
|
34 |
|
35 | export default [
|
36 | {
|
37 | input: 'lib/index-bundle.ts',
|
38 | output: [{
|
39 | file: 'dist/vis-network.esm.js',
|
40 | format: 'esm',
|
41 | banner: genHeader('network'),
|
42 | sourcemap: true
|
43 | }, {
|
44 | file: 'dist/vis-network.js',
|
45 | format: 'umd',
|
46 | exports: 'named',
|
47 | name: 'vis',
|
48 | extend: true,
|
49 | banner: genHeader('network'),
|
50 | sourcemap: true
|
51 | }],
|
52 | plugins: [
|
53 | plugins.commonjs,
|
54 | plugins.nodeResolve,
|
55 | plugins.cssRaw,
|
56 | plugins.typescript,
|
57 | plugins.babel
|
58 | ]
|
59 | },
|
60 | {
|
61 | input: 'lib/index-bundle.ts',
|
62 | output: [{
|
63 | file: 'dist/vis-network.esm.min.js',
|
64 | format: 'esm',
|
65 | banner: genHeader('network'),
|
66 | sourcemap: true
|
67 | }, {
|
68 | file: 'dist/vis-network.min.js',
|
69 | format: 'umd',
|
70 | exports: 'named',
|
71 | name: 'vis',
|
72 | extend: true,
|
73 | banner: genHeader('network'),
|
74 | sourcemap: true
|
75 | }],
|
76 | plugins: [
|
77 | plugins.commonjs,
|
78 | plugins.nodeResolve,
|
79 | plugins.cssMin,
|
80 | plugins.typescript,
|
81 | plugins.babel,
|
82 | plugins.minify
|
83 | ]
|
84 | }
|
85 | ]
|