-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
40 lines (39 loc) · 1.04 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
import commonjs from '@rollup/plugin-commonjs';
import postcss from 'rollup-plugin-postcss-modules';
import typescript from '@rollup/plugin-typescript';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import image from '@rollup/plugin-image';
import imageInliner from 'postcss-image-inliner';
export default {
input: 'src/main.ts',
output: {
file: 'dist/bundle.js',
format: 'iife',
sourcemap: true,
globals: {
react: 'React',
'react-dom': 'ReactDOM',
}
},
external: ['react', 'react-dom'],
plugins: [
postcss({
modules: true,
extract: true,
writeDefinitions: true,
plugins: [
imageInliner({
assetPaths: ['src/img/**'],
maxFileSize: 50 * 1024,
strict: true,
})
]
}),
commonjs(),
typescript(),
nodeResolve(),
image({
include: 'src/img/**',
})
]
};