Use webpack.

This commit is contained in:
Alexis Lahouze 2017-06-10 18:02:19 +02:00
parent 1a43135e55
commit 5c25d5c79f
4 changed files with 110 additions and 27 deletions

View File

@ -15,13 +15,27 @@
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with Accountant. If not, see <http://www.gnu.org/licenses/>. along with Accountant. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* jshint node: true */
'use strict'; 'use strict';
angular.module('accountant.accounts', [ var angular = require('angular');
'ngResource',
'ngMessages', var ngResource = require('angular-resource'),
'ui-notification', ngMessages = require('angular-messages'),
'ngBootbox' ngUiNotification = require('angular-ui-notification'),
ngBootbox = require('ngbootbox');
// Note: ngBootbox seems to have no module.exports.
ngBootbox = 'ngBootbox';
// FIXME Alexis Lahouze 2017-06-06 move into templates.js.
require('../views/account.form.tmpl.html');
var accountModule = angular.module('accountant.accounts', [
ngResource,
ngMessages,
ngUiNotification,
ngBootbox
]) ])
.config(function($resourceProvider) { .config(function($resourceProvider) {
@ -245,3 +259,5 @@ angular.module('accountant.accounts', [
} }
}; };
}); });
module.exports = accountModule;

View File

@ -15,16 +15,44 @@
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with Accountant. If not, see <http://www.gnu.org/licenses/>. along with Accountant. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* jshint node: true */
'use strict'; 'use strict';
angular.module('accountant', [ var angular = require('angular');
'accountant.accounts',
'accountant.operations', var ngRoute = require('angular-route'),
'accountant.scheduler', ngBootbox = require('ngbootbox'),
'ngRoute', ngStorage = require('meanie-angular-storage'),
'ngBootbox', ngHttpAuth = require('angular-http-auth');
'http-auth-interceptor',
'Storage.Service' var base64 =require('base64util');
// Note: ngBootbox seems to have no module.exports.
ngBootbox = 'ngBootbox';
// Note: ngHttpAuth seems to have no module.exports.
ngHttpAuth = 'http-auth-interceptor';
var accountModule = require('./accounts'),
operationModule = require('./operations'),
schedulerModule = require('./scheduler');
require('bootstrap-webpack!./bootstrap.config.js');
require('../views/operations.html');
require('../views/accounts.html');
require('../views/scheduler.html');
require('../views/login.tmpl.html');
var app = angular.module('accountant', [
accountModule.name,
operationModule.name,
schedulerModule.name,
ngRoute,
ngBootbox,
ngHttpAuth,
ngStorage
]) ])
.factory('sessionInjector', function($storage) { .factory('sessionInjector', function($storage) {
@ -162,3 +190,5 @@ angular.module('accountant', [
}) })
; ;
module.exports = app;

View File

@ -15,16 +15,34 @@
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with Accountant. If not, see <http://www.gnu.org/licenses/>. along with Accountant. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* jshint node: true */
'use strict'; 'use strict';
angular.module('accountant.operations', [ var moment = require('moment'),
'accountant.accounts', Highcharts = require('highstock-release');
'ngRoute',
'ngResource', var angular = require('angular');
'ngBootbox',
'ui-notification', require('../views/operation.form.tmpl.html');
'mgcrea.ngStrap',
'highcharts-ng' var ngResource = require('angular-resource'),
ngMessages = require('angular-messages'),
ngUiNotification = require('angular-ui-notification'),
ngBootbox = require('ngbootbox'),
ngStrap = require('angular-strap');
// Note: ngBootbox seems to have no module.exports.
ngBootbox = 'ngBootbox';
var accountModule = require('./accounts');
var operationModule = angular.module('accountant.operations', [
accountModule.name,
ngResource,
ngMessages,
ngUiNotification,
ngBootbox,
ngStrap
]) ])
.config(function($resourceProvider) { .config(function($resourceProvider) {
@ -539,3 +557,5 @@ angular.module('accountant.operations', [
} }
}; };
}); });
module.exports = operationModule;

View File

@ -15,14 +15,29 @@
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with Accountant. If not, see <http://www.gnu.org/licenses/>. along with Accountant. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* jshint node: true */
'use strict'; 'use strict';
angular.module('accountant.scheduler', [ var angular = require('angular');
'ngRoute',
'ngBootbox', var ngMessages = require('angular-messages'),
'ui-notification', ngUiNotification = require('angular-ui-notification'),
'xeditable', ngBootbox = require('ngbootbox'),
'mgcrea.ngStrap' ngStrap = require('angular-strap'),
ngXEditable = require('angular-xeditable');
// Note: ngBootbox seems to have no module.exports.
ngBootbox = 'ngBootbox';
// Note: angular-xeditable seems to have no module.exports.
ngXEditable = 'xeditable';
var schedulerModule = angular.module('accountant.scheduler', [
ngMessages,
ngUiNotification,
ngBootbox,
ngXEditable,
ngStrap
]) ])
.config(function($resourceProvider) { .config(function($resourceProvider) {
@ -122,3 +137,5 @@ angular.module('accountant.scheduler', [
}) })
; ;
module.exports = schedulerModule;