Skip to content

Commit 6974914

Browse files
committed
add unminified option
1 parent 34c09c3 commit 6974914

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tasks/partial_bundle.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ function isFalse(a) {
3636
);
3737
}
3838

39+
function inputBoolean(a, dflt) {
40+
return !a ? dflt : !isFalse(a);
41+
}
42+
3943
function inputArray(a, dflt) {
4044
dflt = dflt.slice();
4145

@@ -52,6 +56,7 @@ if(process.argv.length > 2) {
5256
var args = minimist(process.argv.slice(2), {});
5357

5458
// parse arguments
59+
var unminified = inputBoolean(args.unminified, false);
5560
var out = args.out ? args.out : 'custom';
5661
var traces = inputArray(args.traces, allTraces);
5762
var transforms = inputArray(args.transforms, allTransforms);
@@ -61,10 +66,15 @@ if(process.argv.length > 2) {
6166
transformList: createList([], transforms, allTransforms, 'transform'),
6267

6368
name: out,
64-
index: path.join(constants.pathToLib, 'index-' + out + '.js'),
65-
distMin: path.join(constants.pathToDist, 'plotly-' + out + '.min.js')
69+
index: path.join(constants.pathToLib, 'index-' + out + '.js')
6670
};
6771

72+
if(unminified) {
73+
opts.dist = path.join(constants.pathToDist, 'plotly-' + out + '.js');
74+
} else {
75+
opts.distMin = path.join(constants.pathToDist, 'plotly-' + out + '.min.js');
76+
}
77+
6878
console.log(opts);
6979

7080
opts.calendars = true;

0 commit comments

Comments
 (0)