-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
38 lines (31 loc) · 1.04 KB
/
index.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
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
const combine = require('stream-combiner');
const builder = require("./builder");
const tsbundle = require("./tsbundle");
const jsbundle = require("./jsbundle");
const jsfilter = require("./jsfilter");
module.exports = function(options = {})
{
const transforms = [builder(options)];
//
// When typescript is enabled tsbundle and jsbundle transformations are enabled
// by default. These transforamtions can be disabled by setting tsbundle:false
// and jsbundle:false respectively.
//
const typescript = options.args && options.args.includes("--typescript");
if(typescript && options.tsbundle !== false)
{
transforms.push(tsbundle(options));
}
if((typescript && options.jsbundle !== false) || (options.jsbundle === true))
{
transforms.push(jsbundle(options));
}
transforms.push(jsfilter());
return combine(transforms);
};
module.exports.builder = builder;
module.exports.jsbundle = jsbundle;
module.exports.tsbundle = tsbundle;