Create Webpack entry points for each plugin

User Story # #5697

Signed-off-by: Alex Coles <alex@alexbcoles.com>
This commit is contained in:
Alex Coles
2014-11-20 15:20:39 +01:00
parent 04c285ae56
commit 3d34ff2eda
4 changed files with 15 additions and 5 deletions
+1 -1
View File
@@ -45,7 +45,7 @@
/backup
/.project
/.loadpath
/app/assets/javascripts/openproject-app.bundle.js*
/app/assets/javascripts/bundles/*.js*
/config/additional_environment.rb
/config/configuration.yml
/config/database.yml
+2 -1
View File
@@ -54,7 +54,8 @@
//= require versions
//= require_tree ./specific
//= require ./openproject-app.bundle
//= require ./bundles/openproject-app
//= require_tree ./bundles
//source: http://stackoverflow.com/questions/8120065/jquery-and-prototype-dont-work-together-with-array-prototype-reverse
if (typeof []._reverse == 'undefined') {
+1
View File
@@ -59,6 +59,7 @@ var TranslationsPlugin = {
}
};
exports.pluginNamesPaths = OpenProjectPlugins.pluginNamesPaths();
exports.pluginDirectories = OpenProjectPlugins.pluginDirectories();
exports.translationsPluginLocales = TranslationsPlugin.findLocaleFiles();
exports.translationsPluginPath = TranslationsPlugin.findPluginPath();
+11 -3
View File
@@ -1,15 +1,23 @@
var webpack = require('webpack'),
path = require('path'),
_ = require('lodash'),
pathConfig = require('./config/rails-plugins.conf');
var pluginEntries = _.reduce(pathConfig.pluginNamesPaths, function(entries, path, name) {
entries[name.replace(/^openproject\-/, '')] = name;
return entries;
}, {});
module.exports = {
context: __dirname + '/app/assets/javascripts/angular',
entry: './openproject-app.js',
entry: _.merge({
app: './openproject-app.js'
}, pluginEntries),
output: {
filename: 'openproject-app.bundle.js',
path: path.join(__dirname, 'app', 'assets', 'javascripts')
filename: 'openproject-[name].js',
path: path.join(__dirname, 'app', 'assets', 'javascripts', 'bundles')
},
module: {