generated from dev-protocol/template-repos-cjs-esm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
52 lines (50 loc) · 1.06 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
41
42
43
44
45
46
47
48
49
50
51
52
import _alias from '@rollup/plugin-alias'
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import resolve from '@rollup/plugin-node-resolve'
// import builtins from 'rollup-plugin-node-builtins'
const alias = _alias({
entries: {
crypto: 'empty-module',
assert: 'empty-module',
http: 'empty-module',
https: 'empty-module',
os: 'empty-module',
url: 'empty-module',
zlib: 'empty-module',
stream: 'empty-module',
_stream_duplex: 'empty-module',
_stream_passthrough: 'empty-module',
_stream_readable: 'empty-module',
_stream_writable: 'empty-module',
_stream_transform: 'empty-module',
},
})
export default [
{
input: 'index.js',
output: [
{
dir: 'dist',
format: 'es',
},
],
plugins: [alias, resolve({ preferBuiltins: false }), commonjs(), json()],
},
{
input: 'index.js',
output: [
{
dir: 'dist/browser',
format: 'es',
},
],
plugins: [
alias,
// builtins(),
resolve({ browser: true, preferBuiltins: false }),
commonjs({ browser: true }),
json(),
],
},
]