-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.js
34 lines (30 loc) · 957 Bytes
/
build.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
var rollup = require('rollup').rollup;
var npm = require('rollup-plugin-node-resolve');
var commonjs = require('rollup-plugin-commonjs');
console.log("Creating rollup bundle")
rollup({
entry: './lib/sofe.js',
plugins: [
npm({
// use "jsnext:main" if possible
// – see https://github.com/rollup/rollup/wiki/jsnext:main
jsnext: true,
// use "main" field or index.js, even if it's not an ES6 module
// (needs to be converted from CommonJS to ES6
// – see https://github.com/rollup/rollup-plugin-commonjs
main: true
// if there's something your bundle requires that you DON'T
// want to include, add it to 'skip'
// skip: [ 'some-big-dependency' ],
}),
commonjs(),
]
}).then( function(bundle) {
bundle.write({ dest: 'dist/sofe.js', format: 'cjs' })
console.log("Wrote rollup bundle into dist")
})
.catch(function(err) {
setTimeout(function() {
throw err;
});
});