about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/initializers/frontends.rb7
-rw-r--r--config/webpack/shared.js15
2 files changed, 9 insertions, 13 deletions
diff --git a/config/initializers/frontends.rb b/config/initializers/frontends.rb
new file mode 100644
index 000000000..2cb68cc61
--- /dev/null
+++ b/config/initializers/frontends.rb
@@ -0,0 +1,7 @@
+# Be sure to restart your server when you modify this file.
+
+Rails.application.configure do
+  frontends = []
+  Rails.root.join('app', 'javascript', 'packs', 'frontends').each_child(false) { |f| frontends.push f.to_s }
+  config.x.available_frontends = frontends
+end
diff --git a/config/webpack/shared.js b/config/webpack/shared.js
index 98e864a66..425918d66 100644
--- a/config/webpack/shared.js
+++ b/config/webpack/shared.js
@@ -2,7 +2,7 @@
 
 const { existsSync } = require('fs');
 const webpack = require('webpack');
-const { basename, dirname, join, relative, resolve, sep } = require('path');
+const { basename, dirname, join, relative, resolve } = require('path');
 const { sync } = require('glob');
 const ExtractTextPlugin = require('extract-text-webpack-plugin');
 const ManifestPlugin = require('webpack-manifest-plugin');
@@ -54,18 +54,7 @@ module.exports = {
     }),
     new webpack.optimize.CommonsChunkPlugin({
       name: 'common',
-      minChunks: (module, count) => {
-        const reactIntlPathRegexp = new RegExp(`node_modules\\${sep}react-intl`);
-
-        if (module.resource && reactIntlPathRegexp.test(module.resource)) {
-          // skip react-intl because it's useless to put in the common chunk,
-          // e.g. because "shared" modules between zh-TW and zh-CN will never
-          // be loaded together
-          return false;
-        }
-
-        return count >= 2;
-      },
+      minChunks: Infinity, // It doesn't make sense to use common chunks with multiple frontend support.
     }),
   ],