forked from lukasoppermann/html5sortable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
52 lines (50 loc) · 1.24 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
import uglify from 'rollup-plugin-uglify'
import typescript from 'rollup-plugin-typescript'
import strip from 'rollup-plugin-strip-code'
import pkg from './package.json'
let dir = `${pkg.dest}/`
let banner = `/*
* HTML5Sortable package
* https://github.com/lukasoppermann/html5sortable
*
* Maintained by Lukas Oppermann <[email protected]>
*
* Released under the MIT license.
*/`
let plugins = [
typescript({
target: 'ES5'
})
]
// strip test code if not in testing mode
if (!process.env.test) {
plugins = [...plugins, strip({
start_comment: 'START.TESTS_ONLY',
end_comment: 'END.TESTS_ONLY'
})]
} else {
dir = '_test/'
}
export default [
{
input: pkg.file,
output: {
name: 'sortable',
file: `${dir}${pkg.name}.min.js`,
format: 'iife',
sourcemap: true,
banner: banner
},
plugins: [...plugins, uglify()]
},
{
input: pkg.file,
output: [
{ file: `${dir}${pkg.name}.js`, format: 'iife', name: 'sortable', banner: banner },
{ file: `${dir}${pkg.name}.cjs.js`, format: 'cjs', banner: banner },
{ file: `${dir}${pkg.name}.amd.js`, format: 'amd', banner: banner },
{ file: `${dir}${pkg.name}.es.js`, format: 'es', banner: banner }
],
plugins: plugins
}
]