Skip to content

Commit 4b0f1da

Browse files
committed
delete index-custom after bundle
1 parent 6974914 commit 4b0f1da

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

tasks/partial_bundle.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ if(process.argv.length > 2) {
7878
console.log(opts);
7979

8080
opts.calendars = true;
81+
opts.deleteIndex = true;
8182

8283
var tasks = [];
8384

@@ -92,6 +93,7 @@ if(process.argv.length > 2) {
9293
function partialBundle(tasks, opts) {
9394
var name = opts.name;
9495
var index = opts.index;
96+
var deleteIndex = opts.deleteIndex;
9597
var dist = opts.dist;
9698
var distMin = opts.distMin;
9799
var traceList = opts.traceList;
@@ -131,6 +133,7 @@ function partialBundle(tasks, opts) {
131133
tasks.push(function(done) {
132134
var bundleOpts = {
133135
standalone: 'Plotly',
136+
deleteIndex: deleteIndex,
134137
pathToMinBundle: distMin
135138
};
136139

tasks/util/browserify_wrapper.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ module.exports = function _bundle(pathToIndex, pathToBundle, opts, cb) {
4949
var pending = (pathToMinBundle && pathToBundle) ? 2 : 1;
5050

5151
function done() {
52-
if(cb && --pending === 0) cb(null);
52+
if(cb && --pending === 0) {
53+
if(opts.deleteIndex) {
54+
console.log('delete', pathToIndex);
55+
fs.unlinkSync(pathToIndex, {});
56+
}
57+
58+
cb(null);
59+
}
5360
}
5461

5562
var bundleStream = b.bundle(function(err) {

0 commit comments

Comments
 (0)