forked from EdgeApp/edge-core-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
61 lines (56 loc) · 1.45 KB
/
rollup.config.js
File metadata and controls
61 lines (56 loc) · 1.45 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import alias from 'rollup-plugin-alias'
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import packageJson from './package.json'
const babelOpts = {
presets: ['es2015-rollup', 'flow'],
plugins: [
'transform-async-to-generator',
['transform-es2015-for-of', { loose: true }],
'transform-object-rest-spread',
'transform-regenerator'
]
}
const commonjsOpts = {
include: 'build/crypto-bundle.js'
}
const external = [
'regenerator-runtime/runtime',
...Object.keys(packageJson.dependencies),
...Object.keys(packageJson.devDependencies)
]
export default [
{
external,
input: 'src/edge-core-index.js',
output: [
{ file: packageJson.main, format: 'cjs' },
{ file: packageJson.module, format: 'es' }
],
plugins: [
alias({
'./io/node/node-io.js': 'src/io/node/node-io.js',
'./io/react-native/react-native-io.js':
'src/io/react-native/react-native-dummy.js'
}),
commonjs(commonjsOpts),
babel(babelOpts)
],
sourcemap: true
},
{
external,
input: 'src/edge-core-index.js',
output: { file: packageJson['react-native'], format: 'cjs' },
plugins: [
alias({
'./io/node/node-io.js': 'src/io/node/node-dummy.js',
'./io/react-native/react-native-io.js':
'src/io/react-native/react-native-io.js'
}),
commonjs(commonjsOpts),
babel(babelOpts)
],
sourcemap: true
}
]