私は探していて探していてどこにでも見ていて、私はこのコードが何と呼ばれているか分かりません。私はjQueryからそれを取り出した私はこのコードが何であるか全くわかりません
(function(global, factory) {
"use strict";
if (typeof module === "object" && typeof module.exports === "object") {
// For CommonJS and CommonJS-like environments where a proper `window`
// is present, execute the factory and get jQuery.
// For environments that do not have a `window` with a `document`
// (such as Node.js), expose a factory as module.exports.
// This accentuates the need for the creation of a real `window`.
// e.g. var jQuery = require("jquery")(window);
// See ticket #14549 for more info.
module.exports = global.document ?
factory(global, true) :
function(w) {
if (!w.document) {
throw new Error("jQuery requires a window with a document");
}
return factory(w);
};
} else {
factory(global);
}
// Pass this if window is not defined yet
})(typeof window !== "undefined" ? window : this, function(window, noGlobal) {...})
私を助けてくれる人は誰ですか?
これは、スクリプトのさまざまな読み込み方法をサポートするためのラッパーです。これは、 'exports'と' require() 'を使うCommonJSスタイルのモジュールシステム(NodeJSのような)と、グローバルを定義することでブラウザで使うことができます。 [UMDjs](https://github.com/umdjs/umd)プロジェクトには、さまざまな組み合わせのテンプレートが用意されています。 –
コメントを市民的かつ建設的にしてください。 –
Hmm。また、私の場合はidkが削除されますが、すべてのコメントは削除されます –