-
Notifications
You must be signed in to change notification settings - Fork 5
/
rollup.js
43 lines (37 loc) · 919 Bytes
/
rollup.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
const babel = require('rollup-plugin-babel')
const commonjs = require('rollup-plugin-commonjs')
const resolve = require('rollup-plugin-node-resolve')
const rollup = require('rollup')
let config = {
entry: 'src/index.js',
plugins: [
babel({
presets: ['es2015-rollup'],
babelrc: false
})
]
}
rollup.rollup(config).then(bundle => {
bundle.write({
format: 'cjs',
moduleName: 'FlickityTransformer',
dest: 'dist/flickity-transformer.js'
})
})
config.plugins.push(resolve({
jsnext: true,
main: true
}))
config.plugins.push(commonjs())
rollup.rollup(config).then(bundle => {
bundle.write({
format: 'iife',
moduleName: 'FlickityTransformer',
dest: 'dist/flickity-transformer.pkgd.js'
})
bundle.write({
format: 'iife',
moduleName: 'FlickityTransformer',
dest: 'test/functional/flickity-transformer.js'
})
}).catch(err => console.log(err.stack))