-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
34 lines (31 loc) · 943 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
// "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 { eslint } from 'rollup-plugin-eslint';
import { uglify } from 'rollup-plugin-uglify';
import filesize from 'rollup-plugin-filesize';
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: 'overstock',
},
external: [],
context: 'this',
plugins: [
isProd && eslint({
throwOnError: true,
throwOnWarning: true,
exclude: ['node_modules/**', '**/**/*.less'],
}),
babel({
exclude: 'node_modules/**',
}),
isProd && uglify(),
filesize(),
],
};