Skip to content

Commit

Permalink
match sinon implementation of bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j committed Mar 24, 2020
1 parent 3adac16 commit 474d97f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4,618 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fake-timers.js
pkg/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.idea
.nyc_output/
coverage/
pkg/
10 changes: 8 additions & 2 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ var fs = require("fs");
var browserify = require("browserify");
var timers = require("./src/fake-timers-src.js");

try {
fs.mkdirSync("pkg");
} catch (ignore) {
// We seem to have it already
}

function makeBundle(entryPoint, config, done) {
browserify(entryPoint, config).bundle(function(err, buffer) {
if (err) {
Expand All @@ -21,7 +27,7 @@ makeBundle(
detectGlobals: false
},
function(bundle) {
fs.writeFileSync("fake-timers.js", bundle);
fs.writeFileSync("pkg/fake-timers.js", bundle);
}
);

Expand Down Expand Up @@ -49,6 +55,6 @@ makeBundle(
})
.join("\n");

fs.writeFileSync("fake-timers-esm.js", source);
fs.writeFileSync("pkg/fake-timers-esm.js", source);
}
);

0 comments on commit 474d97f

Please sign in to comment.