-
Notifications
You must be signed in to change notification settings - Fork 2
/
rollup.config.mjs
44 lines (42 loc) · 1.16 KB
/
rollup.config.mjs
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
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import { babel } from '@rollup/plugin-babel';
import typescript from '@rollup/plugin-typescript';
import postcss from 'rollup-plugin-postcss';
import image from '@rollup/plugin-image';
import replace from '@rollup/plugin-replace';
import serve from 'rollup-plugin-serve';
import livereload from 'rollup-plugin-livereload';
const config = {
input: 'demo/index.tsx',
output: {
file: 'build/index.js',
format: 'umd',
sourcemap: true,
},
plugins: [
replace({
preventAssignment: true,
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
__dirname: '',
}),
resolve(),
commonjs(),
babel({
include: ['demo/**/*', 'packages/**/*'],
exclude: '**/node_modules/**',
extensions: ['.js', '.jsx', '.ts', '.tsx'],
babelHelpers: 'bundled',
}),
typescript({ tsconfig: './tsconfig.json', outputToFilesystem: true }),
image(),
postcss(),
serve({
contentBase: ['', 'demo'],
host: 'localhost',
port: 3000,
}),
livereload({ watch: 'build' }),
],
};
export default config;