-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrollup.config.js
More file actions
43 lines (42 loc) · 1.11 KB
/
rollup.config.js
File metadata and controls
43 lines (42 loc) · 1.11 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
import { terser } from 'rollup-plugin-terser'
import replace from '@rollup/plugin-replace'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import typescript from '@rollup/plugin-typescript'
import json from '@rollup/plugin-json'
import nodePolyfills from 'rollup-plugin-node-polyfills'
import nodeGlobals from 'rollup-plugin-node-globals'
// import dynamicImportVars from '@rollup/plugin-dynamic-import-vars'
export default {
input: './src/index.ts',
output: {
exports: 'named',
format: 'es',
file: './dist/index.mjs',
sourcemap: false,
},
treeshake: {},
plugins: [
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
'process.nextTick': undefined,
setImmediate: undefined,
process: '({})',
}),
nodeResolve({ browser: true }),
commonjs({
transformMixedEsModules: true,
}),
json(),
nodePolyfills(),
nodeGlobals(),
typescript(),
// dynamicImportVars({ warnOnError: true }),
terser({
ecma: 'ESNext',
output: {
comments: false,
},
}),
],
}