[CORD-1001] Solved race condition in autogeneration of models and tweaks for slow connections

Change-Id: Ifcbc4f9057f04e19703af96f8d8294f2b975be66
diff --git a/conf/webpack.conf.js b/conf/webpack.conf.js
index 8bef911..5506296 100644
--- a/conf/webpack.conf.js
+++ b/conf/webpack.conf.js
@@ -5,6 +5,7 @@
 const HtmlWebpackPlugin = require('html-webpack-plugin');
 const autoprefixer = require('autoprefixer');
 const CopyWebpackPlugin = require('copy-webpack-plugin');
+const ExtractTextPlugin = require('extract-text-webpack-plugin');
 const env = process.env.NODE_ENV || 'production';
 const brand = process.env.BRAND || 'cord';
 
@@ -27,13 +28,15 @@
       },
       {
         test: /\.(css|scss)$/,
-        loaders: [
-          'style',
-          'css',
-          'resolve-url-loader',
-          'sass?sourceMap',
-          'postcss'
-        ]
+        loaders: ExtractTextPlugin.extract({
+          fallbackLoader: 'style',
+          loader: [
+            'css',
+            'resolve-url-loader',
+            'sass?sourceMap',
+            'postcss'
+          ]
+        })
       },
       {
         test: /\.ts$/,
@@ -66,14 +69,15 @@
     new webpack.NoErrorsPlugin(),
     new HtmlWebpackPlugin({
       template: conf.path.src('index.html')
-    })
+    }),
+    new ExtractTextPlugin('index-[contenthash].css'),
   ],
   postcss: () => [autoprefixer],
   debug: true,
   devtool: 'source-map',
   output: {
     path: path.join(process.cwd(), conf.paths.tmp),
-    filename: 'index.js'
+    filename: '[name].js'
   },
   resolve: {
     extensions: [
@@ -84,7 +88,10 @@
       '.ts'
     ]
   },
-  entry: `./${conf.path.src('index')}`,
+  entry: {
+    indes: `./${conf.path.src('index')}`,
+    loader: `./${conf.path.src('/app/style/imports/loader.scss')}`
+  },
   ts: {
     configFileName: 'tsconfig.json'
   },