Skip to content

Commit

Permalink
Add knockout plugins to common.js
Browse files Browse the repository at this point in the history
Not because they should be there, but to work around
browserify/browserify#850
  • Loading branch information
mwiencek committed Nov 13, 2014
1 parent 8b7adb4 commit c420d4a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
10 changes: 0 additions & 10 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,6 @@ function createBundle(resourceName, watch) {
debug: !!process.env.DEBUG
});

switch (resourceName) {
case "common.js":
// XXX The knockout-* plugins in edit.js attempt to require() knockout as a CommonJS module
b.require("./root/static/lib/knockout/knockout-latest.debug.js", { expose: "knockout" });
break;
case "edit.js":
b.external("./root/static/lib/knockout/knockout-latest.debug.js");
break;
}

if (process.env.UGLIFY) {
b.transform("uglifyify", {
// See https://github.com/substack/node-browserify#btransformtr-opts
Expand Down
4 changes: 4 additions & 0 deletions root/static/scripts/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ require("jquery.tablesorter");
require("jquery.cookie");
require("jquery.ui");

require("knockout-arrayTransforms");
require("knockout-delegatedEvents");
require("knockout-postbox");

require("./common/MB.js");
require("./common/annotation.js");
require("./common/artworkViewer.js");
Expand Down
4 changes: 0 additions & 4 deletions root/static/scripts/edit.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
require("knockout-arrayTransforms");
require("knockout-delegatedEvents");
require("knockout-postbox");

require("../lib/filesize.js/lib/filesize.js");
require("../lib/json/json2.js");
require("../lib/sha1/sha1.js");
Expand Down

0 comments on commit c420d4a

Please sign in to comment.