Browse Source

Allowed use of require() and Electron now uses it in the CommonJS env

Brad Metcalf 9 years ago
parent
commit
c9231dcd56
2 changed files with 2 additions and 7 deletions
  1. 1 0
      package.json
  2. 1 7
      src/js/bootstrap-dialog.js

+ 1 - 0
package.json

@@ -5,6 +5,7 @@
   "directories": {
     "example": "examples"
   },
+  "main": "dist/js/bootstrap-dialog.js",
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1"
   },

+ 1 - 7
src/js/bootstrap-dialog.js

@@ -17,13 +17,7 @@
 
     // CommonJS module is defined
     if (typeof module !== 'undefined' && module.exports) {
-        var isNode = (typeof process === "object") && (typeof process.versions === "object");
-        var isElectron = isNode && ('electron' in process.versions);
-        if (isElectron) {
-            root.BootstrapDialog = factory(root.jQuery);
-        } else {
-            module.exports = factory(require('jquery'), require('bootstrap'));
-        }
+        module.exports = factory(require('jquery'), require('bootstrap'));
     }
     // AMD module is defined
     else if (typeof define === "function" && define.amd) {