forked from EdgeApp/edge-core-js
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrollup.config.js
53 lines (50 loc) · 1.2 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
53
import alias from 'rollup-plugin-alias'
import babel from 'rollup-plugin-babel'
import flowEntry from 'rollup-plugin-flow-entry'
import packageJson from './package.json'
const external = [
...Object.keys(packageJson.dependencies),
...Object.keys(packageJson.devDependencies),
'@babel/runtime/regenerator',
'react-native'
]
export default [
// Normal build:
{
external,
input: 'src/index.js',
output: [
{ file: packageJson.main, format: 'cjs', sourcemap: true },
{ file: packageJson.module, format: 'es', sourcemap: true }
],
plugins: [
alias({
'./io/react-native/react-native-io.js':
'src/io/react-native/react-native-dummy.js'
}),
babel(),
flowEntry()
]
},
// React Native build:
{
external,
input: 'src/index.js',
output: {
file: 'build/react-native.js',
format: 'cjs',
sourcemap: true
},
plugins: [
alias({ './io/node/node-io.js': 'src/io/node/node-dummy.js' }),
babel()
]
},
// Client-side methods:
{
external: ['yaob'],
input: 'src/client-side.js',
output: { file: 'lib/client-side.js', format: 'es', sourcemap: true },
plugins: [babel()]
}
]