summaryrefslogtreecommitdiff
path: root/web-ui/webpack.production.config.js
diff options
context:
space:
mode:
authorAnike Arni <aarni@thoughtworks.com>2016-12-28 17:51:54 -0200
committerAnike Arni <aarni@thoughtworks.com>2016-12-28 17:51:54 -0200
commitee97dee72ec1673ad18fe86855b1e1aceabba674 (patch)
treee337e6bce3fcd77fd4d953d5cc6f44ab7e2b2188 /web-ui/webpack.production.config.js
parent93cec7cbc6c03b2bd95b1e031e894327bdaa65b4 (diff)
Use webpack files for packaging
Diffstat (limited to 'web-ui/webpack.production.config.js')
-rw-r--r--web-ui/webpack.production.config.js111
1 files changed, 111 insertions, 0 deletions
diff --git a/web-ui/webpack.production.config.js b/web-ui/webpack.production.config.js
new file mode 100644
index 00000000..36eb9396
--- /dev/null
+++ b/web-ui/webpack.production.config.js
@@ -0,0 +1,111 @@
+var path = require('path');
+var webpack = require('webpack');
+var CopyWebpackPlugin = require('copy-webpack-plugin');
+
+module.exports = {
+ entry: './app/js/index.js',
+ node: { fs: 'empty' },
+ output: {
+ path: path.join(__dirname, '/dist/'),
+ filename: 'app.min.js',
+ publicPath: '/assets/js/'
+ },
+ 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')
+ },
+ extensions: ['', '.js']
+ },
+ module: {
+ loaders: [
+ {
+ test: /\.js$/,
+ loader: 'babel',
+ query: { presets: ['es2015']}
+ }
+ ]
+ },
+ plugins: [
+ new webpack.optimize.UglifyJsPlugin(),
+ new webpack.optimize.DedupePlugin(),
+ new CopyWebpackPlugin([
+ { context: 'app/', from: '404.html' },
+ { context: 'app/', from: 'index.html' },
+ { context: 'app/', from: 'fonts/*' },
+ { context: 'app/', from: 'locales/**/*' },
+ { context: 'app/', from: 'bower_components/font-awesome/fonts/*' },
+ {
+ context: 'app/',
+ from: 'bower_components/font-awesome/css/font-awesome.min.css',
+ to: 'bower_components/font-awesome/css'
+ },
+ {
+ context: 'app/',
+ from: 'bower_components/jquery-file-upload/css/jquery.fileupload.css',
+ to: 'bower_components/jquery-file-upload/css'
+ },
+ {
+ context: 'app/',
+ from: 'bower_components/modernizr/modernizr.js',
+ to: 'bower_components/modernizr'
+ },
+ {
+ context: 'app/',
+ from: 'bower_components/lodash/dist/lodash.min.js',
+ to: 'bower_components/lodash/dist'
+ },
+ {
+ context: 'app/',
+ from: 'bower_components/jquery/dist/jquery.min.js',
+ to: 'bower_components/jquery/dist'
+ },
+ {
+ context: 'app/',
+ from: 'bower_components/jquery-ui/jquery-ui.min.js',
+ to: 'bower_components/jquery-ui'
+ },
+ {
+ context: 'app/',
+ from: 'bower_components/jquery-file-upload/js/jquery.fileupload.js',
+ to: 'bower_components/jquery-file-upload/js'
+ },
+ {
+ context: 'app/',
+ from: 'bower_components/handlebars/handlebars.min.js',
+ to: 'bower_components/handlebars'
+ },
+ {
+ context: 'app/',
+ from: 'bower_components/typeahead.js/dist/typeahead.bundle.min.js',
+ to: 'bower_components/typeahead.js/dist'
+ },
+ {
+ context: 'app/',
+ from: 'bower_components/iframe-resizer/js/iframeResizer.min.js',
+ to: 'bower_components/iframe-resizer/js'
+ }
+ ])
+ ]
+}