-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
47 lines (42 loc) · 899 Bytes
/
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
// rollup.config.js
import resolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';
import postcss from "rollup-plugin-postcss"
import { uglify } from 'rollup-plugin-uglify'
const globals = {
react: 'React',
'react-dom': 'ReactDOM',
'create-react-context': 'createContext',
'prop-types': 'PropTypes'
};
const babelOptions = {
exclude: /node_modules/,
runtimeHelpers: true
}
export default {
input: 'src/index.js',
output: {
file: 'lib/index.js',
format: 'umd',
sourcemap: true,
name: "ReactLoadingTransition",
globals
},
external: (name) =>
[
'react',
'create-react-context',
'react-dom',
'prop-types',
].includes(name) ||
/core-js/.test(name) ||
/szfe-tools/.test(name),
plugins: [
resolve(),
postcss({
extract: true,
}),
babel(babelOptions),
uglify()
]
};