Skip to content

Commit

Permalink
Add support for CommonJS module loaders
Browse files Browse the repository at this point in the history
  • Loading branch information
sloria committed Nov 9, 2014
1 parent 17b0c74 commit 9d1ef69
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/knockout-sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
if (typeof define === "function" && define.amd) {
// AMD anonymous module
define(["knockout", "jquery", "jquery.ui.sortable"], factory);
} else if (typeof module === "object") {
// CommonJS module
var ko = require("knockout");
var jQuery = require("jquery");
require("jquery.ui.sortable");
factory(ko, jQuery);
} else {
// No module loader (plain <script> tag) - put directly in global namespace
factory(window.ko, jQuery);
Expand Down

0 comments on commit 9d1ef69

Please sign in to comment.