-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.app-template.js
47 lines (46 loc) · 1.22 KB
/
rollup.app-template.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
/**
* Function that returns a rollup config for a given application name.
*/
import resolve from 'rollup-plugin-node-resolve'
import typescript from 'rollup-plugin-typescript2'
import postcss from 'rollup-plugin-postcss'
import commonjs from 'rollup-plugin-commonjs'
import replace from 'rollup-plugin-replace'
export default (appName) => ({
input: 'src/index.tsx',
output: [{
file: `../public/${appName}/application.js`,
format: 'iife',
sourcemap: false,
globals: {
'react': 'React',
'react-dom': 'ReactDOM',
'react-router-dom': 'ReactRouterDOM',
'react-redux': 'ReactRedux',
'redux': 'Redux',
'redux-logger': 'reduxLogger'
}
}],
external: [
'react',
'react-dom',
'react-router-dom',
'react-redux',
'redux',
'redux-logger'
],
plugins: [
replace({
'process.env.NODE_ENV': '"development"'
}),
resolve(),
commonjs({
namedExports: {
'react-is': [ 'isValidElementType' ],
'react-iframe': [ 'Iframe' ]
}
}),
typescript(),
postcss()
]
})