0
webpackを使用するようにアプリケーションを変換しようとしています。すべての依存関係を管理するのに苦労しています。私はベンダーのファイルをコンパイルしてOKです。webpackを使用するように古いアプリを変換する
私は以下のファイルを持っています(これは大きなファイルですが、単純化のために大量のファイルを削除しました)。これをエントリーポイントにインポートします。私が試みるものは何でもApp.initは機能ではありません。これをモジュールに変換し、やっているように振る舞うにはどうすればいいですか?例えばApp.someFunction()
var App = function() {
// IE mode
var isRTL = false;
var isIE8 = false;
var isIE9 = false;
var isIE10 = false;
var resizeHandlers = [];
var assetsPath = '/v1/assets/';
// theme layout color set
var brandColors = {
'blue': '#89C4F4',
};
// initializes main settings
var handleInit = function() {
//do stuff
};
// Handlesmaterial design checkboxes
var handleMaterialDesign = function() {
//do stuff
}
// Handles custom checkboxes & radios using jQuery iCheck plugin
var handleiCheck = function() {
//do stuff
};
//* END:CORE HANDLERS *//
return {
//main function to initiate the theme
init: function() {
//IMPORTANT!!!: Do not modify the core handlers call order.
//Core handlers
handleInit(); // initialize core variables
//UI Component handlers
handleMaterialDesign(); // handle material design
},
//main function to initiate core javascript after ajax complete
initAjax: function() {
handleiCheck();
},
//init main components
initComponents: function() {
this.initAjax();
},
};
}();
jQuery(document).ready(function() {
App.init(); // init metronic core componets
});
ありがとう!彼らはES2015の道でしょうか? – jhodgson4