-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.examples.config.js
47 lines (46 loc) · 1020 Bytes
/
rollup.examples.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
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import replace from '@rollup/plugin-replace';
import ts from "@wessberg/rollup-plugin-ts";
import postcss from 'rollup-plugin-postcss';
import copy from 'rollup-plugin-copy';
export default {
input: 'src/examples/index.tsx',
output: [
{
sourcemap: true,
globals: {
'react': 'React',
'react-dom': 'ReactDOM'
},
file: 'dist/react-thumbnails.js',
format: 'umd',
name: 'ReactThumbnails'
}
],
external: ['react', 'react-dom'],
plugins: [
replace({
preventAssignment: true,
values: {
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}
}),
postcss({
extract: false
}),
ts({
tsconfig: 'tsconfig.json'
}),
commonjs(),
resolve({
browser: true,
preferBuiltins: true
}),
copy({
targets: [
{ src: 'public/*', dest: 'dist/' }
]
})
]
};