-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathrollup.config.js
44 lines (40 loc) · 904 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
import buble from 'rollup-plugin-buble'
import nodeResolve from 'rollup-plugin-node-resolve'
import uglify from 'rollup-plugin-uglify'
import filesize from 'rollup-plugin-filesize'
// eslint-disable-next-line
const VERSION = process.env.VERSION
const banner = `/*!
* Laue v${VERSION}
* https://laue.js.org
*
* Copyright (c) 2018 qingwei-li
* Licensed under the MIT license
*/\n`
const configs = []
// ES
configs.push({
input: 'src/index.js',
output: {
format: 'es',
file: 'dist/laue.js',
banner
},
plugins: [buble(), nodeResolve()]
})
// UMD
// eslint-disable-next-line
if (process.env.BUILD === 'production') {
configs.push({
input: 'src/umd.js',
output: {
format: 'umd',
name: 'Laue',
file: 'dist/laue.umd.js',
sourcemap: true,
banner
},
plugins: [buble(), nodeResolve(), uglify(), filesize()]
})
}
export default configs