-
Notifications
You must be signed in to change notification settings - Fork 2
/
rollup.config.js
66 lines (65 loc) · 1.52 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import babel from '@rollup/plugin-babel'
import esbuild from 'rollup-plugin-esbuild'
import external from 'rollup-plugin-peer-deps-external'
import postcss from 'rollup-plugin-postcss'
import resolve from '@rollup/plugin-node-resolve'
import filesize from 'rollup-plugin-filesize'
import progress from 'rollup-plugin-progress'
import json from 'rollup-plugin-json'
import url from 'rollup-plugin-url'
import svgr from '@svgr/rollup'
import pkg from './package.json'
export default {
input: 'src/index.tsx',
output: [
{
file: pkg.exports.require,
format: 'cjs',
exports: 'named',
sourcemap: true,
},
{
file: pkg.exports.import,
format: 'es',
exports: 'named',
sourcemap: true,
},
{
file: './dist/index.iife.js',
format: 'iife',
name: 'ReactICD10',
globals: {
react: 'React',
},
sourcemap: true,
},
],
plugins: [
json(),
external(),
url(),
svgr(),
postcss({ modules: true }),
resolve({
extensions: ['.js'],
moduleDirectories: ['node_modules'],
preferBuiltins: true,
}),
filesize(),
progress(),
babel({
extensions: ['.js'],
babelHelpers: 'runtime',
presets: ['@babel/preset-env'],
plugins: ['@babel/transform-runtime'],
}),
esbuild({
experimentalBundling: true,
include: /\.[t]s?$/,
exclude: /node_modules/,
minify: process.env.NODE_ENV !== 'development',
target: 'es2020',
sourceMap: true,
}),
],
}