ソースを参照

Merge pull request #277 from baconface/master

Allowed use of require() and Electron now uses it in the CommonJS env
Dante 9 年 前
コミット
74cf2e165e

+ 1 - 7
dist/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) {

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/js/bootstrap-dialog.min.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) {