-
Notifications
You must be signed in to change notification settings - Fork 28
/
build.js
25 lines (22 loc) · 851 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
var umd = require('../');
var fs = require('fs');
var join = require('path').join;
fs.createReadStream(join(__dirname, 'cjs', 'index.js'))
.pipe(umd('common-js-module', true))
.pipe(fs.createWriteStream(join(__dirname, 'cjs', 'bundle.js')))
.on('close', end);
fs.createReadStream(join(__dirname, 'raw', 'index.js'))
.pipe(umd('common-js-module', false))
.pipe(fs.createWriteStream(join(__dirname, 'raw', 'bundle.js')))
.on('close', end);
fs.createReadStream(join(__dirname, 'constructor', 'index.js'))
.pipe(umd('Common-Js-Module', false))
.pipe(fs.createWriteStream(join(__dirname, 'constructor', 'bundle.js')))
.on('close', end);
var remaining = 2;
function end() {
if (0 !== --remaining) return;
console.log(require('./cjs/bundle'));
console.log(require('./raw/bundle'));
console.log(require('./constructor/bundle'));
}