|
1 | 1 | import { defineConfig } from 'rollup'
|
2 |
| -import pluginTs from '@rollup/plugin-typescript' |
3 | 2 | import dts from 'rollup-plugin-dts'
|
| 3 | +import pluginTs from '@rollup/plugin-typescript' |
4 | 4 | import terser from '@rollup/plugin-terser'
|
5 | 5 |
|
6 | 6 | const input = 'src/BeautifulTree.tsx'
|
7 | 7 | const external = ['react', 'react-dom', 'react/jsx-runtime']
|
8 | 8 | const globals = {
|
9 | 9 | react: 'React',
|
10 |
| - 'react-dom': 'ReactDOM', |
| 10 | + 'react-dom': 'ReactDOM', |
11 | 11 | 'react/jsx-runtime': 'jsxRuntime',
|
12 | 12 | }
|
13 | 13 |
|
14 | 14 | export default defineConfig([
|
15 |
| - { |
16 |
| - input, |
17 |
| - output: [ |
18 |
| - { |
19 |
| - file: 'dist/beautiful-tree.cjs', |
20 |
| - format: 'cjs', |
21 |
| - globals, |
22 |
| - sourcemap: true |
23 |
| - }, |
24 |
| - { |
25 |
| - file: 'dist/beautiful-tree.mjs', |
26 |
| - format: 'es', |
27 |
| - globals, |
28 |
| - sourcemap: true |
29 |
| - }, |
30 |
| - { |
31 |
| - name: 'BeautifulTree', |
32 |
| - file: 'dist/beautiful-tree.iife.js', |
33 |
| - format: 'iife', |
34 |
| - globals, |
35 |
| - sourcemap: true |
36 |
| - }, |
37 |
| - { |
38 |
| - name: 'BeautifulTree', |
39 |
| - file: 'dist/beautiful-tree.umd.js', |
40 |
| - format: 'umd', |
41 |
| - globals, |
42 |
| - sourcemap: true, |
43 |
| - }, |
44 |
| - ], |
45 |
| - external, |
46 |
| - plugins: [pluginTs()] |
47 |
| - }, |
48 |
| - { |
49 |
| - input, |
50 |
| - output: [ |
51 |
| - { |
52 |
| - file: 'dist/beautiful-tree.min.cjs', |
53 |
| - format: 'cjs', |
54 |
| - globals, |
55 |
| - sourcemap: true, |
56 |
| - }, |
57 |
| - { |
58 |
| - file: 'dist/beautiful-tree.min.mjs', |
59 |
| - format: 'es', |
60 |
| - globals, |
61 |
| - sourcemap: true, |
62 |
| - }, |
63 |
| - { |
64 |
| - name: 'BeautifulTree', |
65 |
| - file: 'dist/beautiful-tree.min.iife.js', |
66 |
| - format: 'iife', |
67 |
| - globals, |
68 |
| - sourcemap: true, |
69 |
| - }, |
70 |
| - { |
71 |
| - name: 'BeautifulTree', |
72 |
| - file: 'dist/beautiful-tree.min.umd.js', |
73 |
| - format: 'umd', |
74 |
| - globals, |
75 |
| - sourcemap: true, |
76 |
| - }, |
77 |
| - ], |
78 |
| - external, |
79 |
| - plugins: [pluginTs(), terser()] |
80 |
| - }, |
81 |
| - { |
82 |
| - input, |
83 |
| - output: [ |
84 |
| - { file: 'dist/beautiful-tree.d.ts' }, |
85 |
| - ], |
86 |
| - external, |
87 |
| - plugins: [dts()] |
88 |
| - }, |
| 15 | + { |
| 16 | + input, |
| 17 | + output: [ |
| 18 | + { |
| 19 | + file: 'dist/beautiful-tree.cjs', |
| 20 | + format: 'cjs', |
| 21 | + globals, |
| 22 | + sourcemap: true, |
| 23 | + }, |
| 24 | + { |
| 25 | + file: 'dist/beautiful-tree.mjs', |
| 26 | + format: 'es', |
| 27 | + globals, |
| 28 | + sourcemap: true, |
| 29 | + }, |
| 30 | + { |
| 31 | + name: 'BeautifulTree', |
| 32 | + file: 'dist/beautiful-tree.iife.js', |
| 33 | + format: 'iife', |
| 34 | + globals, |
| 35 | + sourcemap: true, |
| 36 | + }, |
| 37 | + { |
| 38 | + name: 'BeautifulTree', |
| 39 | + file: 'dist/beautiful-tree.umd.js', |
| 40 | + format: 'umd', |
| 41 | + globals, |
| 42 | + sourcemap: true, |
| 43 | + }, |
| 44 | + ], |
| 45 | + external, |
| 46 | + plugins: [pluginTs()], |
| 47 | + }, |
| 48 | + { |
| 49 | + input, |
| 50 | + output: [ |
| 51 | + { |
| 52 | + file: 'dist/beautiful-tree.min.cjs', |
| 53 | + format: 'cjs', |
| 54 | + globals, |
| 55 | + sourcemap: true, |
| 56 | + }, |
| 57 | + { |
| 58 | + file: 'dist/beautiful-tree.min.mjs', |
| 59 | + format: 'es', |
| 60 | + globals, |
| 61 | + sourcemap: true, |
| 62 | + }, |
| 63 | + { |
| 64 | + name: 'BeautifulTree', |
| 65 | + file: 'dist/beautiful-tree.min.iife.js', |
| 66 | + format: 'iife', |
| 67 | + globals, |
| 68 | + sourcemap: true, |
| 69 | + }, |
| 70 | + { |
| 71 | + name: 'BeautifulTree', |
| 72 | + file: 'dist/beautiful-tree.min.umd.js', |
| 73 | + format: 'umd', |
| 74 | + globals, |
| 75 | + sourcemap: true, |
| 76 | + }, |
| 77 | + ], |
| 78 | + external, |
| 79 | + plugins: [pluginTs(), terser()], |
| 80 | + }, |
| 81 | + { |
| 82 | + input, |
| 83 | + output: [{ file: 'dist/beautiful-tree.d.ts' }], |
| 84 | + external, |
| 85 | + plugins: [dts()], |
| 86 | + }, |
89 | 87 | ])
|
0 commit comments