-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.js
More file actions
45 lines (41 loc) · 1.05 KB
/
Copy pathrollup.config.js
File metadata and controls
45 lines (41 loc) · 1.05 KB
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
import babel from 'rollup-plugin-babel';
import cjs from 'rollup-plugin-commonjs';
import globals from 'rollup-plugin-node-globals';
import replace from 'rollup-plugin-replace';
import resolve from 'rollup-plugin-node-resolve';
const external = [
'@react-pdf/renderer',
'react',
'react-dom',
];
export default {
input: 'src/main.js',
output: {
file: 'build/build.js',
format: 'iife',
name: 'bundle',
},
// Specify here external modules which you don't want to include
// in your bundle (for instance: 'lodash', 'moment' etc.)
// https://rollupjs.org/guide/en#external-e-external
external,
plugins: [
// Compile TypeScript/JavaScript files
babel({
babelrc: false,
exclude: 'node_modules/**',
presets: [
'@babel/preset-env',
'@babel/preset-react'
],
plugins: [],
}),
// Allow bundling cjs modules. Rollup doesn't understand cjs
cjs({
exclude: 'src/**',
}),
globals(),
replace({ 'process.env.NODE_ENV': JSON.stringify('development') }),
resolve(),
],
};