summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnike Arni <aarni@thoughtworks.com>2016-12-29 10:54:40 -0200
committerAnike Arni <aarni@thoughtworks.com>2016-12-29 10:54:40 -0200
commitee82bd9ea42fe9acbe0c9750931a899ada335cfa (patch)
tree53084ee80a94bae6db07f712fe8b22ac3a30ea3e
parent639430167b646de6fdbb0f275386dae2856b7e72 (diff)
Move aliases to common folder for local and production compilation
-rw-r--r--web-ui/config/alias-webpack.js28
-rw-r--r--web-ui/webpack.config.js37
-rw-r--r--web-ui/webpack.production.config.js38
3 files changed, 45 insertions, 58 deletions
diff --git a/web-ui/config/alias-webpack.js b/web-ui/config/alias-webpack.js
new file mode 100644
index 00000000..f4ea1b63
--- /dev/null
+++ b/web-ui/config/alias-webpack.js
@@ -0,0 +1,28 @@
+var path = require('path');
+
+module.exports = {
+ 'DOMPurify': 'dompurify',
+ 'i18nextXHRBackend': 'i18next-xhr-backend',
+ 'i18nextBrowserLanguageDetector': 'i18next-browser-languagedetector',
+ 'flight': path.join(__dirname, '../app/bower_components/flight'),
+ 'found': path.join(__dirname, '../app/bower_components/foundation'),
+ 'js': path.join(__dirname, '../app/js'),
+ 'mail_list': path.join(__dirname, '../app/js/mail_list'),
+ 'page': path.join(__dirname, '../app/js/page'),
+ 'feedback': path.join(__dirname, '../app/js/feedback'),
+ 'hbs': path.join(__dirname, '../app/js/generated/hbs'),
+ 'helpers': path.join(__dirname, '../app/js/helpers'),
+ 'lib': path.join(__dirname, '../app/js/lib'),
+ 'views': path.join(__dirname, '../app/js/views'),
+ 'tags': path.join(__dirname, '../app/js/tags'),
+ 'mail_list_actions': path.join(__dirname, '../app/js/mail_list_actions'),
+ 'user_alerts': path.join(__dirname, '../app/js/user_alerts'),
+ 'mail_view': path.join(__dirname, '../app/js/mail_view'),
+ 'dispatchers': path.join(__dirname, '../app/js/dispatchers'),
+ 'services': path.join(__dirname, '../app/js/services'),
+ 'mixins': path.join(__dirname, '../app/js/mixins'),
+ 'search': path.join(__dirname, '../app/js/search'),
+ 'foundation': path.join(__dirname, '../app/js/foundation'),
+ 'features': path.join(__dirname, '../app/js/features/features'),
+ 'user_settings': path.join(__dirname, '../app/js/user_settings')
+}
diff --git a/web-ui/webpack.config.js b/web-ui/webpack.config.js
index 794ce08d..99162908 100644
--- a/web-ui/webpack.config.js
+++ b/web-ui/webpack.config.js
@@ -1,42 +1,21 @@
var path = require('path');
var webpack = require('webpack');
-var CopyWebpackPlugin = require('copy-webpack-plugin');
+var copyWebpack = require('./config/copy-webpack');
+var aliases = require('./config/alias-webpack');
module.exports = {
- entry: './app/js/index.js',
+ entry: {
+ app: './app/js/index.js',
+ sandbox: './app/js/sandbox.js'
+ },
node: { fs: 'empty' },
output: {
path: path.join(__dirname, 'dist'),
- filename: 'app.min.js',
+ filename: '[name].js',
publicPath: '/assets/'
},
resolve: {
- alias: {
- 'DOMPurify': 'dompurify',
- 'i18nextXHRBackend': 'i18next-xhr-backend',
- 'i18nextBrowserLanguageDetector': 'i18next-browser-languagedetector',
- 'flight': path.join(__dirname, '/app/bower_components/flight'),
- 'found': path.join(__dirname, '/app/bower_components/foundation'),
- 'js': path.join(__dirname, '/app/js'),
- 'mail_list': path.join(__dirname, '/app/js/mail_list'),
- 'page': path.join(__dirname, '/app/js/page'),
- 'feedback': path.join(__dirname, '/app/js/feedback'),
- 'hbs': path.join(__dirname, '/app/js/generated/hbs'),
- 'helpers': path.join(__dirname, '/app/js/helpers'),
- 'lib': path.join(__dirname, '/app/js/lib'),
- 'views': path.join(__dirname, '/app/js/views'),
- 'tags': path.join(__dirname, '/app/js/tags'),
- 'mail_list_actions': path.join(__dirname, '/app/js/mail_list_actions'),
- 'user_alerts': path.join(__dirname, '/app/js/user_alerts'),
- 'mail_view': path.join(__dirname, '/app/js/mail_view'),
- 'dispatchers': path.join(__dirname, '/app/js/dispatchers'),
- 'services': path.join(__dirname, '/app/js/services'),
- 'mixins': path.join(__dirname, '/app/js/mixins'),
- 'search': path.join(__dirname, '/app/js/search'),
- 'foundation': path.join(__dirname, '/app/js/foundation'),
- 'features': path.join(__dirname, '/app/js/features/features'),
- 'user_settings': path.join(__dirname, '/app/js/user_settings')
- },
+ alias: aliases,
extensions: ['', '.js']
},
module: {
diff --git a/web-ui/webpack.production.config.js b/web-ui/webpack.production.config.js
index 78cfe843..bddbbe9c 100644
--- a/web-ui/webpack.production.config.js
+++ b/web-ui/webpack.production.config.js
@@ -1,41 +1,21 @@
var path = require('path');
var webpack = require('webpack');
-var CopyWebpackPlugin = require('copy-webpack-plugin');
+var copyWebpack = require('./config/copy-webpack');
+var aliases = require('./config/alias-webpack');
module.exports = {
- entry: './app/js/index.js',
+ entry: {
+ app: './app/js/index.js',
+ sandbox: './app/js/sandbox.js'
+ },
node: { fs: 'empty' },
output: {
- path: path.join(__dirname, '/dist/'),
- filename: 'app.min.js',
+ path: path.join(__dirname, 'dist'),
+ filename: '[name].js',
publicPath: '/assets/'
},
resolve: {
- alias: {
- 'js': path.join(__dirname, '/app/js'),
- 'flight': path.join(__dirname, '/app/bower_components/flight'),
- 'mail_list': path.join(__dirname, '/app/js/mail_list'),
- 'page': path.join(__dirname, '/app/js/page'),
- 'feedback': path.join(__dirname, '/app/js/feedback'),
- 'DOMPurify': 'dompurify',
- 'i18nextXHRBackend': 'i18next-xhr-backend',
- 'i18nextBrowserLanguageDetector': 'i18next-browser-languagedetector',
- 'hbs': path.join(__dirname, '/app/js/generated/hbs'),
- 'helpers': path.join(__dirname, '/app/js/helpers'),
- 'lib': path.join(__dirname, '/app/js/lib'),
- 'views': path.join(__dirname, '/app/js/views'),
- 'tags': path.join(__dirname, '/app/js/tags'),
- 'mail_list_actions': path.join(__dirname, '/app/js/mail_list_actions'),
- 'user_alerts': path.join(__dirname, '/app/js/user_alerts'),
- 'mail_view': path.join(__dirname, '/app/js/mail_view'),
- 'dispatchers': path.join(__dirname, '/app/js/dispatchers'),
- 'services': path.join(__dirname, '/app/js/services'),
- 'mixins': path.join(__dirname, '/app/js/mixins'),
- 'search': path.join(__dirname, '/app/js/search'),
- 'foundation': path.join(__dirname, '/app/js/foundation'),
- 'features': path.join(__dirname, '/app/js/features/features'),
- 'user_settings': path.join(__dirname, '/app/js/user_settings')
- },
+ alias: aliases,
extensions: ['', '.js']
},
module: {