-
-
Notifications
You must be signed in to change notification settings - Fork 89
/
Copy pathrollup.config.js
50 lines (44 loc) · 1.09 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
const { babel } = require('@rollup/plugin-babel')
const { terser } = require('rollup-plugin-terser')
const { version, homepage, author } = require('./package.json')
const year = new Date().getFullYear()
const buildProd = process.env.PROD === 'true'
const buildDev = process.env.DEV === 'true'
const conf = {
input: './src/js/index.js',
output: {
banner:
`/*!
* bsStepper v${version} (${homepage})
* Copyright 2018 - ${year} ${author}
* Licensed under MIT (https://github.com/Johann-S/bs-stepper/blob/master/LICENSE)
*/`,
file: './dist/js/bs-stepper.js',
format: 'umd',
name: 'Stepper',
sourcemap: true
},
plugins: [
babel({
exclude: 'node_modules/**',
// Include the helpers in the bundle, at most one copy of each
babelHelpers: 'bundled'
})
]
}
if (buildDev) {
conf.output.file = './tests/dist/js/bs-stepper.js'
}
if (buildProd) {
conf.output.file = './dist/js/bs-stepper.min.js'
conf.plugins.push(terser({
compress: {
typeofs: false
},
mangle: true,
output: {
comments: /^!/
}
}))
}
module.exports = conf