forked from veks/button-visually-impaired-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
61 lines (58 loc) · 1.77 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
55
56
57
58
59
60
61
'use strict'
import babel from 'rollup-plugin-babel'
import commonjs from '@rollup/plugin-commonjs'
import replace from 'rollup-plugin-replace'
import {nodeResolve} from '@rollup/plugin-node-resolve'
import nodePolyfills from 'rollup-plugin-node-polyfills'
import {version, homepage, author, license} from './package.json'
const path = require('path')
const production = !process.env.ROLLUP_WATCH
const name = 'bvi'
const banner = `/*!
* Button visually impaired - v${version} ${homepage}
* Copyright 2014-${new Date().getFullYear()} ${author}.
* Licensed ${license} (https://github.com/veks/button-visually-impaired-javascript/blob/master/LICENSE.md)
*/`
export default {
input: path.resolve(__dirname, 'src/js/index.umd.js'),
output: {
banner,
name: 'isvek',
file: path.resolve(__dirname, `dist/js/${name}.js`),
format: 'umd',
},
plugins: [
nodePolyfills(),
nodeResolve({
browser: true,
preferBuiltins: true,
jsnext: true,
main: true,
brower: true,
}),
commonjs({
include: 'node_modules/**',
}),
babel({
exclude: 'node_modules/**',
babelrc: false,
presets: [
[
'@babel/preset-env',
{
modules: false,
targets: {
browsers: '> 0.5%, ie >= 9',
},
useBuiltIns: 'entry',
corejs: 3,
debug: true,
},
],
],
}),
replace({
'process.env': production ? '"production"' : '"dev"',
}),
],
}