Merge pull request #2192 from opf/feature/webpack-bundling-enhancements

pull/2197/head
Hagen Schink 10 years ago
commit 6711aea3ba
  1. 2
      app/assets/javascripts/angular/api/hal-api-resource.js
  2. 20
      app/assets/javascripts/angular/openproject-app.js
  3. 1
      app/assets/javascripts/application.js.erb
  4. 5
      karma.conf.js
  5. 1
      protractor/index.html
  6. 17
      webpack.config.js

@ -26,6 +26,8 @@
// See doc/COPYRIGHT.rdoc for more details.
//++
require('hyperagent');
module.exports = function HALAPIResource($q, PathHelper) {
'use strict';

@ -26,14 +26,6 @@
// See doc/COPYRIGHT.rdoc for more details.
//++
var URI = require('uri.js/src/URI');
var URITemplate = require('uri.js/src/URITemplate');
window.URI = URI;
window.URITemplate = URITemplate;
require('hyperagent/dist/hyperagent');
var I18n = require('./vendor/i18n');
window.I18n = I18n;
I18n.translations.de = require("json!yaml!./../../../../config/locales/js-de.yml").de;
@ -45,15 +37,15 @@ require('angular-modal');
require('angular-ui-router');
require('angular-ui-select2');
require('angular-ui-select2-sortable');
require('angular-ui-date/src/date');
require('angular-ui-date');
require('angular-sanitize');
require('angular-truncate/src/truncate');
require('angular-feature-flags/dist/featureFlags.js');
require('angular-busy/dist/angular-busy.js');
require('angular-truncate');
require('angular-feature-flags');
require('angular-busy');
require('angular-context-menu/dist/angular-context-menu.js');
require('angular-context-menu');
require('openproject-ui_components/app/assets/javascripts/angular/ui-components-app')
require('openproject-ui_components');
// global

@ -16,7 +16,6 @@
//= require jquery-ui
//= require jquery-ui/ui/i18n/jquery.ui.datepicker-en-GB.js
//= require jquery-ui/ui/i18n/jquery.ui.datepicker-de.js
//= require lodash
//= require momentjs
//= require momentjs/lang/en-gb.js
//= require momentjs/lang/de.js

@ -49,7 +49,6 @@ module.exports = function(config) {
// list of files / patterns to load in the browser
files: [
"vendor/assets/components/jquery/dist/jquery.js",
"vendor/assets/components/lodash/dist/lodash.js",
"vendor/assets/components/momentjs/moment.js",
"vendor/assets/components/moment-timezone/moment-timezone.js",
'vendor/assets/components/select2/select2.js',
@ -151,9 +150,7 @@ module.exports = function(config) {
webpack: require('./webpack.config.js'),
webpackServer: {
stats: {
colors: true
}
noInfo: true
}
});
};

@ -21,7 +21,6 @@
<!-- Sprockets-managed assets -->
<script src="/bower_components/jquery/dist/jquery.js"></script>
<script src="/bower_components/lodash/dist/lodash.js"></script>
<script src="/bower_components/momentjs/moment.js"></script>
<script src="/bower_components/moment-timezone/moment-timezone.js"></script>
<script src="/bower_components/select2/select2.js"></script>

@ -22,12 +22,27 @@ module.exports = {
modulesDirectories: [
path.join(__dirname, 'node_modules'),
path.join(__dirname, 'vendor', 'assets', 'components')
]
],
alias: {
'angular-ui-date': 'angular-ui-date/src/date',
'angular-truncate': 'angular-truncate/src/truncate',
'angular-feature-flags': 'angular-feature-flags/dist/featureFlags.js',
'angular-busy': 'angular-busy/dist/angular-busy.js',
'angular-context-menu': 'angular-context-menu/dist/angular-context-menu.js',
'hyperagent': 'hyperagent/dist/hyperagent',
'openproject-ui_components': 'openproject-ui_components/app/assets/javascripts/angular/ui-components-app'
}
},
externals: { jquery: "jQuery" },
plugins: [
new webpack.ProvidePlugin({
'_': 'lodash',
'URI': 'URIjs',
'URITemplate': 'URIjs/src/URITemplate'
}),
new webpack.ResolverPlugin([
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin(
'bower.json', ['main'])

Loading…
Cancel
Save