Create Webpack entry points for each plugin

User Story # #5697

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/2193/head
Alex Coles 10 years ago
parent 04c285ae56
commit 3d34ff2eda
  1. 2
      .gitignore
  2. 3
      app/assets/javascripts/application.js.erb
  3. 1
      config/rails-plugins.conf.js
  4. 14
      webpack.config.js

2
.gitignore vendored

@ -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

@ -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') {

@ -59,6 +59,7 @@ var TranslationsPlugin = {
}
};
exports.pluginNamesPaths = OpenProjectPlugins.pluginNamesPaths();
exports.pluginDirectories = OpenProjectPlugins.pluginDirectories();
exports.translationsPluginLocales = TranslationsPlugin.findLocaleFiles();
exports.translationsPluginPath = TranslationsPlugin.findPluginPath();

@ -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: {

Loading…
Cancel
Save