-
Notifications
You must be signed in to change notification settings - Fork 10
/
rollup.config.js
49 lines (43 loc) · 1.12 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
import external from 'rollup-plugin-peer-deps-external';
import resolve from 'rollup-plugin-node-resolve';
import filesize from 'rollup-plugin-filesize';
import progress from 'rollup-plugin-progress';
import postcss from 'rollup-plugin-postcss';
import babel from 'rollup-plugin-babel';
import { terser } from "rollup-plugin-terser";
export default {
input: 'src/index.js',
output: [
{
file: 'lib/index.js',
format: 'es',
sourcemap: false,
name: '@yrobot/react-mobile-table',
},
],
plugins: [
resolve({
extensions: ['.js', '.jsx', '.ts', '.tsx'],
jsnext: true,
}),
babel({
extensions: ['.js', '.jsx', '.ts', '.tsx'],
include: ['**/*'],
exclude: 'node_modules/**',
}),
terser(),
// Automatically externalize peerDependencies in a rollup bundle.
external(),
postcss({
minimize: true, // uses cssnano behind scene
modules: false, // enable css modules
extract: true,
use: ['less'],
extensions: ['.css', '.scss', '.sass', '.less'], // uses node-sass
}),
filesize(),
// Progress while building
progress({ clearLine: false }),
],
external: ['react', 'react-dom'],
};