forked from awell-health/ui-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
55 lines (54 loc) · 1.29 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
import { DEFAULT_EXTENSIONS } from '@babel/core'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import { babel } from '@rollup/plugin-babel'
import ts2 from 'rollup-plugin-typescript2'
import json from '@rollup/plugin-json'
import del from 'rollup-plugin-delete'
import svg from 'rollup-plugin-svg'
import postcss from 'rollup-plugin-postcss'
export default {
input: `src/index.ts`,
output: [
{
file: 'dist/index.js',
name: '@awell_health/ui-library',
format: 'umd',
globals: {
react: 'react',
'react-dom': 'react-dom',
},
},
],
external: ['react', 'react-dom'],
plugins: [
del({ targets: 'dist/*' }),
json(),
svg(),
commonjs(),
resolve({ browser: true }),
postcss({
extract: true,
autoModules: true,
use: ['sass'],
}),
ts2({
tsconfigOverride: {
include: ['src/**/*'],
exclude: [
'**/*.stories.*',
'**/*.test.ts',
'**/*.test.tsx',
'**/*.spec.ts',
'**/*.spec.tsx',
],
},
useTsconfigDeclarationDir: true,
}),
babel({
babelHelpers: 'bundled',
extensions: [...DEFAULT_EXTENSIONS, '.ts', '.tsx'],
exclude: '../node_modules/**',
}),
],
}