forked from jcmcneal/react-step-wizard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
54 lines (51 loc) · 1.42 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
54
// "dev": "rollup --config rollup.config.js --watch",
// "build": "rollup --config rollup.config.js --environment NODE_ENV:production",
import path from 'path';
import babel from 'rollup-plugin-babel';
import postcss from 'rollup-plugin-postcss';
import { eslint } from 'rollup-plugin-eslint';
import { uglify } from 'rollup-plugin-uglify';
import filesize from 'rollup-plugin-filesize';
import copy from 'rollup-plugin-copy'
import app from './package.json';
const isProd = process.env.NODE_ENV === 'production';
export default {
input: 'src/index.js',
output: {
file: `./dist/${path.basename(app.main)}`,
format: 'umd',
name: 'ReactStepWizard',
exports: 'named',
globals: {
'prop-types': 'PropTypes',
react: 'React',
},
},
external: [
'prop-types',
'react',
],
context: 'this',
plugins: [
isProd && eslint({
throwOnError: true,
throwOnWarning: true,
exclude: ['node_modules/**', '**/**/*.less', '**/**/*.css'],
}),
babel({
exclude: 'node_modules/**',
}),
postcss({
modules: {
generateScopedName: 'rsw_[hash:base64:2]',
},
}),
isProd && uglify(),
filesize(),
copy({
targets: [
{ src: 'src/index.d.ts', dest: 'dist' }
]
})
],
};