この方法で成功しました。(定型プラグインに追加されたため、MIT ライセンス コメントが含まれています)
プロトタイプでの @global + @class と @global の使用を参照してください。それはそれを行うようです。
以下にコピーしたコード: 楽しんで、より良くしてください。
/**
* jQuery lightweight plugin boilerplate
* Original author: @ajpiano
* Further changes, comments: @addyosmani
* Licensed under the MIT license
*/
;(function ( $, window, document, undefined ) {
var pluginName = "Application",
defaults = {
propertyName: "value"
};
/**
* @global
* @class Application
* @description MASTER: Sets up and controls the application
*
* @returns Object
*/
function Application( element, options ) {
this.element = element;
this.options = $.extend( {}, defaults, options) ;
this._defaults = defaults;
this._name = pluginName;
this.init();
window[pluginName] = this;
}
/** @global */
Application.prototype = {
/**
* @description call pre-life initialisations and tests here
*/
init: function() {
var that = this;
that._build();
that._setNotifications();
},
/**
@description Set up a pub sub for global notifications such a state-changes.
*/
_setNotifications: function(el, options) {
console.log('Application=>setNotifications()');
},
/**
@description All environment setup done we now call other plugins.
*/
_build: function(el, options) {
console.log('Application=>build()');
}
};
$.fn[pluginName] = function ( options ) {
return this.each(function () {
if (!$.data(this, "plugin_" + pluginName)) {
$.data(this, "plugin_" + pluginName,
new Application( this, options ));
}
});
};
})( jQuery, window, document );