Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/RainLoop/rainloop-webmail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainLoop Team <support@rainloop.net>2016-08-11 02:16:58 +0300
committerRainLoop Team <support@rainloop.net>2016-08-11 02:16:58 +0300
commit0a2b826f71d5a517e9803c8c438cc5f221b825f8 (patch)
tree3a3900a45ab6c0f8f08cd09f0fd56fdfdbe62cba /webpack.config.builder.js
parent8967bc38179cbcc0e5ea056f2c77efe7ef217ef8 (diff)
Improve building process (es6 bundle)
Diffstat (limited to 'webpack.config.builder.js')
-rw-r--r--webpack.config.builder.js125
1 files changed, 125 insertions, 0 deletions
diff --git a/webpack.config.builder.js b/webpack.config.builder.js
new file mode 100644
index 000000000..ad2fb55df
--- /dev/null
+++ b/webpack.config.builder.js
@@ -0,0 +1,125 @@
+
+var
+ path = require('path'),
+ webpack = require('webpack'),
+ devPath = path.resolve(__dirname, 'dev');
+
+module.exports = function(es6) {
+ return {
+ entry: es6 ? {
+ 'app.next': __dirname + '/dev/app.jsx',
+ 'admin.next': __dirname + '/dev/admin.jsx'
+ } : {
+ 'boot': __dirname + '/dev/boot.jsx',
+ 'app': __dirname + '/dev/app.jsx',
+ 'admin': __dirname + '/dev/admin.jsx'
+ },
+ output: {
+ pathinfo: true,
+ path: __dirname + '/rainloop/v/0.0.0/static/js/',
+ filename: '[name].js',
+ publicPath: 'rainloop/v/0.0.0/static/js/'
+ },
+ plugins: [
+ new webpack.optimize.OccurrenceOrderPlugin()
+ ],
+ resolve: {
+ modules: [devPath, 'node_modules'],
+ extensions: ['', '.js', '.jsx'],
+ alias: {
+ 'Opentip': __dirname + '/dev/External/Opentip.js',
+ 'ko': __dirname + '/dev/External/ko.js'
+ }
+ },
+ module: {
+ loaders: [
+ {
+ test: /\.jsx?$/,
+ loader: 'babel',
+ include: [devPath],
+ query: !es6 ? {
+ cacheDirectory: true,
+ presets: [['es2015', {loose: true, modules: false}], 'es2016', 'stage-0'],
+ plugins: ['transform-runtime']
+ } : {
+ cacheDirectory: true,
+ plugins: [
+// es2015
+["transform-es2015-template-literals", {loose: true}],
+"transform-es2015-literals",
+"transform-es2015-function-name",
+// ["transform-es2015-arrow-functions")],
+"transform-es2015-block-scoped-functions",
+// ["transform-es2015-classes", loose],
+// "transform-es2015-object-super",
+"transform-es2015-shorthand-properties",
+"transform-es2015-duplicate-keys",
+["transform-es2015-computed-properties", {loose: true}],
+["transform-es2015-for-of", {loose: true}],
+"transform-es2015-sticky-regex",
+"transform-es2015-unicode-regex",
+// "check-es2015-constants",
+//["transform-es2015-spread", {loose: true}],
+// "transform-es2015-parameters",
+//["transform-es2015-destructuring", {loose: true}],
+// "transform-es2015-block-scoping",
+"transform-es2015-typeof-symbol",
+// ["transform-regenerator", { async: false, asyncGenerators: false }],
+
+// es2016
+"transform-exponentiation-operator",
+
+// stage-0
+"transform-do-expressions",
+"transform-function-bind",
+
+// stage-1
+"transform-class-constructor-call",
+"transform-export-extensions",
+
+// stage-2
+"transform-class-properties",
+"transform-object-rest-spread",
+"transform-decorators",
+
+// stage-3
+"syntax-trailing-function-commas",
+"transform-async-to-generator",
+"transform-exponentiation-operator",
+
+// runtime
+'transform-runtime'
+ ]
+ }
+ },
+ {
+ test: /\.(html|css)$/,
+ loader: 'raw',
+ include: [devPath]
+ },
+ {
+ test: /\.json$/,
+ loader: 'json',
+ include: [devPath]
+ }
+ ]
+ },
+ externals: {
+ 'window': 'window',
+ 'progressJs': 'window.progressJs',
+ 'moment': 'window.moment',
+ 'ifvisible': 'window.ifvisible',
+ 'crossroads': 'window.crossroads',
+ 'hasher': 'window.hasher',
+ 'Jua': 'window.Jua',
+ 'Autolinker': 'window.Autolinker',
+ 'Tinycon': 'window.Tinycon',
+ 'ssm': 'window.ssm',
+ 'key': 'window.key',
+ '_': 'window._',
+ 'qr': 'window.qr',
+ 'Promise': 'window.Promise',
+ '$': 'window.jQuery'
+ }
+ }
+};