locked
App for cordova on Windows 10 Mobile have js runtime errors while on Android it works fine - tried building from cmd and in VS 2015 RRS feed

  • Question

  • I'm fighting with this few days already.

    When I'm building and deploying Windows app from commandline, I'm doing it this way:

    npm run build:windows which is

    C:\Users\user\Development\Projects\project1>npm run build:windows

        > kbd-tracking@2.0.0 build:windows C:\Users\user\Development\Projects\project1> webpack --bail --progress --profile && cd cordova && (cordova platform add windows || true) && cordova build windows --arch=arm --bundle --win --debug

        12460ms build modules
        16ms seal
        15ms optimize
        16ms hashing
        2635ms create chunk assets
        0ms additional chunk assets
        0ms optimize chunk assets
        173ms optimize assets
        265ms emit
        Hash: c1a928f034fa45cb2a76
        Version: webpack 1.14.0
        Time: 15673ms
                                                               Asset     Size  Chunks             Chunk Names
         vendor/roboto-medium.1f501cf47cadbbc3212c56711a3e3839.woff2  51.2 kB          [emitted]
            vendor/roboto-light.b79522175f88bda408abf034d117dd05.eot  59.9 kB          [emitted]
           vendor/roboto-light.ac0c35482c35b8f57d32e00674d4bb47.woff  70.5 kB          [emitted]
            vendor/roboto-light.3f184bea32d73374548d8de3bd62fb27.ttf   137 kB          [emitted]
            vendor/roboto-light.bb241b1f84305bea134e3133db9659af.svg   633 kB          [emitted]
          vendor/roboto-regular.10ea934f1ff7d7e3595d97799c0762a1.eot  62.4 kB          [emitted]
        vendor/roboto-regular.f380c676d7a1af64d6c6de6fc83dad6c.woff2  54.1 kB          [emitted]
         vendor/roboto-regular.22aeb7df55e4d6275625d030ef9a3e3a.woff  73.7 kB          [emitted]
          vendor/roboto-regular.d8686f57b28f619c83fc65db4884adcb.ttf   142 kB          [emitted]
          vendor/roboto-regular.78bb99180f2a3a9ca397937936eb15f7.svg   603 kB          [emitted]
           vendor/roboto-medium.e03bb62c41172529ea11fe3cfda2d724.eot  59.4 kB          [emitted]
          vendor/roboto-light.4be2d580900a937ab7923d3698a255de.woff2  51.5 kB          [emitted]
          vendor/roboto-medium.5130749b1350d6df7fd56364d4eb8b20.woff  69.9 kB          [emitted]
           vendor/roboto-medium.ccfbb611fc9b2f59826be6bcd3499022.ttf   135 kB          [emitted]
           vendor/roboto-medium.657a8d38b779bdcb54fc59da69fdced6.svg   594 kB          [emitted]
             vendor/roboto-bold.6809de7b8fddfd517dc42239c61d75fe.eot  57.8 kB          [emitted]
           vendor/roboto-bold.be053ebe7f36a2933c78d602f2cd35ba.woff2  49.9 kB          [emitted]
            vendor/roboto-bold.7c2b1f2f9ad5e9fd3ad57aadee875479.woff  68.5 kB          [emitted]
             vendor/roboto-bold.7c22307fc1eb7906083093286ff38b3e.ttf   133 kB          [emitted]
             vendor/roboto-bold.1c38ace315e809bea2fc233f5630308f.svg   592 kB          [emitted]
                                  vendor/app.c1a928f034fa45cb2a76.js  10.8 MB       0  [emitted]  app
                                                          index.html     7 kB          [emitted]
            + 462 hidden modules
        Child html-webpack-plugin for "index.html":
                + 3 hidden modules
        Adding windows project...
        Creating Cordova Windows Project:
                Path: platforms\windows
                Namespace: com.pg.APPtracking1617Vendor341
                Name: MyStore
        Windows project created with cordova-windows@4.4.3
        Access rules must begin with "https://", the following rule will be ignored: tel:*
        The following navigation rule had an invalid URI scheme and will be ignored: "*".
        The following navigation rule had an invalid URI scheme and will be ignored: "data:*".
        Access rules must begin with "https://", the following rule will be ignored: tel:*
        Installing "cordova-plugin-compat" for windows
        Installing "cordova-plugin-geolocation" for windows
        Dependent plugin "cordova-plugin-compat" already installed on windows.
        Installing "cordova-plugin-whitelist" for windows
        Installing "cordova-sqlite-storage" for windows
        installing external dependencies via npm
        npm install of external dependencies ok
        Access rules must begin with "https://", the following rule will be ignored: tel:*
        The following navigation rule had an invalid URI scheme and will be ignored: "*".
        The following navigation rule had an invalid URI scheme and will be ignored: "data:*".
        Access rules must begin with "https://", the following rule will be ignored: tel:*
        Access rules must begin with "https://", the following rule will be ignored: tel:*
        The following navigation rule had an invalid URI scheme and will be ignored: "*".
        The following navigation rule had an invalid URI scheme and will be ignored: "data:*".
        Access rules must begin with "https://", the following rule will be ignored: tel:*
        Building project: C:\Users\user\Development\Projects\project1\cordova\platforms\windows\CordovaApp.Windows10.jsproj
                Configuration : debug
                Platform      : arm
          Patching 10 in prebuild event...
          Injected base.js reference to the /www/index.html
          Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.WinJS.2.0\/js\/base.js">\s*<\/script>)(\s*)/ from /www/index.html
          Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.Phone.WinJS.2.1\/js\/base.js">\s*<\/script>)(\s*)/ from /www/index.html
             Creating library C:\Users\user\Development\Projects\project1\cordova\plugins\cordova-sqlite-storage\src\windows\SQLite3-Win-RT\SQLite3\SQLite3.UWP\arm\debug\SQLite3.UWP\SQLite3.UWP.lib and object C:\Users\user\Development\Projects\project1\cordova\plugins\cordova-sqlite-storage\src\windows\SQLite3-Win-RT\SQLite3\SQLite3.UWP\arm\debug\SQLite3.UWP\SQLite3.UWP.exp
          SQLite3.UWP.vcxproj -> C:\Users\user\Development\Projects\project1\cordova\plugins\cordova-sqlite-storage\src\windows\SQLite3-Win-RT\SQLite3\SQLite3.UWP\arm\debug\SQLite3.UWP\SQLite3.UWP.dll
          SQLite3.UWP.vcxproj -> C:\Users\user\Development\Projects\project1\cordova\plugins\cordova-sqlite-storage\src\windows\SQLite3-Win-RT\SQLite3\SQLite3.UWP\arm\debug\SQLite3.UWP\SQLite3.UWP.pdb (Partial PDB)
        C:\Program Files(x86)\MSBuild\14.0\Microsoft.Common.targets\ImportBefore\Microsoft.
        Cpp.VCLibs120Universal.targets(103,5): warning MSB3842: Project "CordovaApp.Windows10" depends upon SDK "Microsoft Universal CRT Debug Runtime v10.0.10586.0" which supports apps targeting "UAP 10.0". To verify whether "Microsoft Universal CRT Debug Runtime v10.0.10586.0" is compatible with "UAP 10.0.10586.0", contact the SDK author or see http://go.microsoft.com/fwlink/?LinkID=309181. [C:\Users\user\Development\Projects\project1\cordova\platforms\windows\CordovaApp.Windows10.jsproj]
          CordovaApp.Windows10 -> C:\Users\user\Development\Projects\project1\cordova\platforms\windows\AppPackages\CordovaApp.Windows10_0.0.0.1_arm_debug_Test\CordovaApp.Windows10_0.0.0.1_arm_debug.appx
          CordovaApp.Windows10 -> C:\Users\user\Development\Projects\project1\cordova\platforms\windows\AppPackages\CordovaApp.Windows10_0.0.0.1_arm_debug_Test\CordovaApp.Windows10_0.0.0.1_arm_debug.appxsym

    C:\Users\user\Development\Projects\project1>

    And when I deploy it to Lumia 550 with Windows 10 Mobile

        C:\Users\user\Development\Projects\project1>cd cordova

        C:\Users\user\Development\Projects\project1\cordova>cordova run windows --device -- --phone --arch=arm
        Access rules must begin with "https://", the following rule will be ignored: tel:*
        The following navigation rule had an invalid URI scheme and will be ignored: "*".
        The following navigation rule had an invalid URI scheme and will be ignored: "data:*".
        Access rules must begin with "https://", the following rule will be ignored: tel:*
        Building project: C:\Users\user\Development\Projects\project1\cordova\platforms\windows\CordovaApp.Windows10.jsproj
                Configuration : debug
                Platform      : arm
          Patching 10 in prebuild event...
          Injected base.js reference to the /www/index.html
          Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.WinJS.2.0\/js\/base.js">\s*<\/script>)(\s*)/ from /www/index.html
          Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.Phone.WinJS.2.1\/js\/base.js">\s*<\/script>)(\s*)/ from /www/index.html
          SQLite3.UWP.vcxproj -> C:\Users\user\Development\Projects\project1\cordova\plugins\cordova-sqlite-storage\src\windows\SQLite3-Win-RT\SQLite3\SQLite3.UWP\arm\debug\SQLite3.UWP\SQLite3.UWP.dll
          SQLite3.UWP.vcxproj -> C:\Users\user\Development\Projects\project1\cordova\plugins\cordova-sqlite-storage\src\windows\SQLite3-Win-RT\SQLite3\SQLite3.UWP\arm\debug\SQLite3.UWP\SQLite3.UWP.pdb (Partial PDB)
        C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportBefore\Microsoft.Cpp.VCLibs120Universal.targets(103,5): warning MSB3842: Project "CordovaApp.Windows10" depends upon SDK "Microsoft Universal CRT Debug Runtime v10.0.10586.0" which supports apps targeting "UAP 10.0". To verify whether "Microsoft Universal CRT Debug Runtime v10.0.10586.0" is compatible with "UAP 10.0.10586.0", contact the SDK author or see http://go.microsoft.com/fwlink/?LinkID=309181. [C:\Users\user\Development\Projects\project1\cordova\platforms\windows\CordovaApp.Windows10.jsproj]
          CordovaApp.Windows10 -> C:\Users\user\Development\Projects\project1\cordova\platforms\windows\AppPackages\CordovaApp.Windows10_0.0.0.1_arm_debug_Test\CordovaApp.Windows10_0.0.0.1_arm_debug.appx
          CordovaApp.Windows10 -> C:\Users\user\Development\Projects\project1\cordova\platforms\windows\AppPackages\CordovaApp.Windows10_0.0.0.1_arm_debug_Test\CordovaApp.Windows10_0.0.0.1_arm_debug.appxsym
        Deploying windows10 package to device:
        C:\Users\user\Development\Projects\project1\cordova\platforms\windows\AppPackages\CordovaApp.Windows10_0.0.0.1_arm_debug_Test\CordovaApp.Windows10_0.0.0.1_arm_debug.appx
        Attempting to remove previously installed application...
        Deploying app package...
        Cannot launch app with current version of Windows 10 SDK tools. You will have to launch the app after installation is completed.
        Deployment completed successfully.

        C:\Users\user\Development\Projects\project1\cordova>

    The app appears in "Recently added" section in Apps list, and when I click on it to run the app, most of the times black screen appears for a second and app returns to Apps list.

    When I'm building it and debugging with Visual studio 2015 (but before, running module bundling from webpack config, i.e. `webpack --bail --progress --profile` using Task Runner Explorer addon), app most of the time builds and deploys, so I can run it and see the loading screen (css animation before login form to app, but login form never appears because of runtime errors), but while debugging I get JavaScript runtime errors, like:

        'WWAHost.exe' (Script): Loaded 'Script Code (MSAppHost/3.0)'. 
        'WWAHost.exe' (Script): Loaded 'ms-appx-web://com.pg.apptracking1617vendor341/www/vendor/app.31001d2eb956c2104cb7.js'. 
        Exception was thrown at line 1861, column 3 in eval code
        0x800a1389 - JavaScript runtime error: Number.prototype.toPrecision: 'this' is not a Number object
        Exception was thrown at line 2397, column 5 in eval code
        0x800a1608 - JavaScript runtime error: String.prototype.endsWith: first argument cannot be a RegExp
        Exception was thrown at line 2401, column 7 in eval code
        0x800a1608 - JavaScript runtime error: String.prototype.endsWith: first argument cannot be a RegExp
        Exception was thrown at line 2397, column 5 in eval code
        0x800a1608 - JavaScript runtime error: String.prototype.includes: first argument cannot be a RegExp
        Exception was thrown at line 2401, column 7 in eval code
        0x800a1608 - JavaScript runtime error: String.prototype.includes: first argument cannot be a RegExp
        Exception was thrown at line 2397, column 5 in eval code
        0x800a1608 - JavaScript runtime error: String.prototype.startsWith: first argument cannot be a RegExp
        Exception was thrown at line 2401, column 7 in eval code
        0x800a1608 - JavaScript runtime error: String.prototype.startsWith: first argument cannot be a RegExp
        Exception was thrown at line 2603, column 3 in eval code
        0x800a1389 - JavaScript runtime error: Number expected
        Exception was thrown at line 2735, column 33 in eval code
        0x800a139e - JavaScript runtime error: 2
        Exception was thrown at line 2788, column 48 in eval code
        0x800a138f - JavaScript runtime error: Unable to get property 'length' of undefined or null reference
        Exception was thrown at line 2836, column 3 in eval code
        0x800a1396 - JavaScript runtime error: Array.prototype.sort: argument is not a JavaScript object
        Exception was thrown at line 2788, column 48 in eval code
        0x800a138f - JavaScript runtime error: Array.prototype.sort: 'this' is null or undefined
        Exception was thrown at line 2788, column 11 in eval code
        0x800a138f - JavaScript runtime error: Array.prototype.forEach: 'this' is null or undefined
        Exception was thrown at line 2788, column 11 in eval code
        0x800a138f - JavaScript runtime error: Array.prototype.map: 'this' is null or undefined
        Exception was thrown at line 2788, column 11 in eval code
        0x800a138f - JavaScript runtime error: Array.prototype.filter: 'this' is null or undefined
        Exception was thrown at line 2788, column 11 in eval code
        0x800a138f - JavaScript runtime error: Array.prototype.some: 'this' is null or undefined
        Exception was thrown at line 2788, column 11 in eval code
        0x800a138f - JavaScript runtime error: Array.prototype.every: 'this' is null or undefined
        Exception was thrown at line 2788, column 11 in eval code
        0x800a138f - JavaScript runtime error: Array.prototype.reduce: 'this' is null or undefined
        Exception was thrown at line 2788, column 11 in eval code
        0x800a138f - JavaScript runtime error: Array.prototype.reduceRight: 'this' is null or undefined
        Exception was thrown at line 2788, column 48 in eval code
        0x800a138f - JavaScript runtime error: Array.prototype.indexOf: 'this' is null or undefined
        Exception was thrown at line 2788, column 48 in eval code
        0x800a138f - JavaScript runtime error: Array.prototype.lastIndexOf: 'this' is null or undefined
        Exception was thrown at line 3283, column 39 in eval code
        0x800a1398 - JavaScript runtime error: RegExp.prototype.toString: 'this' is not a RegExp object
        Exception was thrown at line 5114, column 7 in eval code
        0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
        Exception was thrown at line 5114, column 7 in eval code
        0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
        Exception was thrown at line 5114, column 7 in eval code
        0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
        Exception was thrown at line 5114, column 7 in eval code
        0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
        Exception was thrown at line 5114, column 7 in eval code
        0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
        Exception was thrown at line 5114, column 7 in eval code
        0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
        Exception was thrown at line 5114, column 7 in eval code
        0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
        Exception was thrown at line 5114, column 7 in eval code
        0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid
        Exception was thrown at line 5114, column 7 in eval code
        0x800a13da - JavaScript runtime error: Typed array constructor argument is invalid


    Here's my `config.xml` for whole cordova project:

        <?xml version="2.0.0" encoding="utf-8"?>
        <widget id="com.pg.APPtracking1617Vendor341" version="2.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" windows-packageVersion="0.0.0.1">
          <name>MyStore</name>
          <description>
                Webpack generated Cordova App
            </description>
          <author email="dev@cordova.apache.org" href="http://cordova.io">
                Apache Cordova Team
            </author>
          <content src="index.html"/>
          <access origin="*" />
          <access launch-external="yes" origin="tel:*" />
          <allow-navigation href="*" />
          <allow-navigation href="http://*/*" />
          <allow-navigation href="https://*/*" />
          <allow-navigation href="data:*" />
          <allow-intent href="*" />
          <access origin="*" />
          <allow-intent href="http://*/*" />
          <allow-intent href="https://*/*" />
          <allow-intent href="tel:*" />
          <allow-intent href="sms:*" />
          <allow-intent href="mailto:*" />
          <allow-intent href="geo:*" />
          <platform name="android">
            <allow-intent href="market:*" />
            <icon density="ldpi" src="resources/android/Icon-ldpi.png" />
            <icon density="mdpi" src="resources/android/Icon-mdpi.png" />
            <icon density="hdpi" src="resources/android/Icon-hdpi.png" />
            <icon density="xhdpi" src="resources/android/Icon-xhdpi.png" />
            <icon density="xxhdpi" src="resources/android/Icon-xxhdpi.png" />
            <icon density="xxxhdpi" src="resources/android/Icon-xxxhdpi.png" />
            <splash density="land-ldpi" src="resources/android/splash/screen-ldpi-landscape.png" />
            <splash density="land-mdpi" src="resources/android/splash/screen-mdpi-landscape.png" />
            <splash density="land-hdpi" src="resources/android/splash/screen-hdpi-landscape.png" />
            <splash density="land-xhdpi" src="resources/android/splash/screen-xhdpi-landscape.png" />
            <splash density="land-xxhdpi" src="resources/android/splash/screen-xxhdpi-landscape.png" />
            <splash density="land-xxxhdpi" src="resources/android/splash/screen-xxxhdpi-landscape.png" />
            <splash density="port-ldpi" src="resources/android/splash/screen-ldpi-portrait.png" />
            <splash density="port-mdpi" src="resources/android/splash/screen-mdpi-portrait.png" />
            <splash density="port-hdpi" src="resources/android/splash/screen-hdpi-portrait.png" />
            <splash density="port-xhdpi" src="resources/android/splash/screen-xhdpi-portrait.png" />
            <splash density="port-xxhdpi" src="resources/android/splash/screen-xxhdpi-portrait.png" />
            <splash density="port-xxxhdpi" src="resources/android/splash/screen-xxxhdpi-portrait.png" />
          </platform>
          <platform name="ios">
            <allow-intent href="itms:*" />
            <allow-intent href="itms-apps:*" />
            <icon src="resources/ios/Icon.png" width="57" height="57" />
            <icon src="resources/ios/Icon@2x.png" width="114" height="114" />
            <icon src="resources/ios/Icon@3x.png" width="171" height="171" />
            <icon src="resources/ios/Icon-40.png" width="40" height="40" />
            <icon src="resources/ios/Icon-40@2x.png" width="80" height="80" />
            <icon src="resources/ios/Icon-40@3x.png" width="120" height="120" />
            <icon src="resources/ios/Icon-Small-50.png" width="50" height="50" />
            <icon src="resources/ios/Icon-Small-50@2x.png" width="100" height="100" />
            <icon src="resources/ios/Icon-60.png" width="60" height="60" />
            <icon src="resources/ios/Icon-60@2x.png" width="120" height="120" />
            <icon src="resources/ios/Icon-60@3x.png" width="180" height="180" />
            <icon src="resources/ios/Icon-72.png" width="72" height="72" />
            <icon src="resources/ios/Icon-72@2x.png" width="144" height="144" />
            <icon src="resources/ios/Icon-76.png" width="76" height="76" />
            <icon src="resources/ios/Icon-76@2x.png" width="152" height="152" />
            <icon src="resources/ios/Icon-Small.png" width="29" height="29" />
            <icon src="resources/ios/Icon-Small@2x.png" width="58" height="58" />
            <icon src="resources/ios/Icon-Small@3x.png" width="87" height="87" />
            <splash src="resources/ios/splash/screen-ipad-landscape.png" width="1024" height="786" />
            <splash src="resources/ios/splash/screen-ipad-landscape-2x.png" width="2048" height="1536" />
            <splash src="resources/ios/splash/screen-ipad-portrait.png" width="786" height="1024" />
            <splash src="resources/ios/splash/screen-ipad-portrait-2x.png" width="1536" height="2048" />
            <splash src="resources/ios/splash/screen-iphone-landscape.png" width="480" height="320" />
            <splash src="resources/ios/splash/screen-iphone-landscape-2x.png" width="960" height="640" />
            <splash src="resources/ios/splash/screen-iphone-landscape-568h-2x.png" width="1136" height="640" />
            <splash src="resources/ios/splash/screen-iphone-landscape-667h.png" width="1334" height="750" />
            <splash src="resources/ios/splash/screen-iphone-landscape-736h.png" width="2208" height="1242" />
            <splash src="resources/ios/splash/screen-iphone-portrait.png" width="320" height="480" />
            <splash src="resources/ios/splash/screen-iphone-portrait-2x.png" width="640" height="960" />
            <splash src="resources/ios/splash/screen-iphone-portrait-568h-2x.png" width="640" height="1136" />
            <splash src="resources/ios/splash/screen-iphone-portrait-667h.png" width="750" height="1334" />
            <splash src="resources/ios/splash/screen-iphone-portrait-736h.png" width="1242" height="2208" />
          </platform>
          <platform name="windows">
          </platform>
          <preference name="windows-target-version" value="10.0" />
          <preference name="WindowsDefaultUriPrefix" value="ms-appx-web://" />
          <preference name="SplashMaintainAspectRatio" value="true" />
          <preference name="FadeSplashScreenDuration" value="300" />
          <preference name="SplashScreen" value="screen" />
          <plugin name="cordova-plugin-whitelist" spec="~1.3.0" />
          <plugin name="cordova-sqlite-storage" spec="~1.5.3" />
          <plugin name="cordova-plugin-geolocation" spec="~2.4.0" />
          <engine name="ios" spec="~4.3.1" />
          <!--<engine name="windows" spec="~4.3.1" />-->
        </widget>

    And here's `webpack.config.js` content:

        'use strict';

        var webpack = require('webpack');
        var autoprefixer = require('autoprefixer');
        var HtmlWebpackPlugin = require('html-webpack-plugin');
        var ExtractTextPlugin = require('extract-text-webpack-plugin');
        var CopyWebpackPlugin = require('copy-webpack-plugin');
        var ngAnnotatePlugin = require('ng-annotate-webpack-plugin');
        var OfflinePlugin = require('offline-plugin');
        var CordovaPlugin = require('webpack-cordova-plugin');

        var ENV = process.env.npm_lifecycle_event;
        var isProd = ENV === 'build';
        var isNative = ENV === 'build:native';
        const METADATA = {
            isNative: isNative,
            isProd: isProd
        };
        module.exports = function makeWebpackConfig() {

            var config = {};
            var developmentPath = __dirname + '/front-end/';
            var buildPath = __dirname + '/src/main/resources/static/';
            var cordovaPath = '/cordova/';

            config.entry = {
                app: developmentPath + 'js/app.js'
            };

            config.output = {
                path: buildPath,
                publicPath: isProd || isNative ? './' : '/',
                filename: 'vendor/[name].[hash].js',
                chunkFilename: 'vendor/[name].[hash].js'
            };

            if (isProd) {
                config.devtool = 'source-map';
            } else {
                config.devtool = 'eval-source-map';
            }

            config.module = {
                preLoaders: [],
                loaders: [
                    {
                        test: /\.js$/,
                        loader: 'babel',
                        exclude: /node_modules/,
                        query: {
                            presets: ['es2015']
                        }
                    },
                    {
                        test: /\.scss$/,
                        loader: ExtractTextPlugin.extract('style', 'css!postcss!sass', {publicPath: '/'})
                    },
                    {
                        test: /\.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot|otf)$/,
                        loader: 'url-loader?limit=10000&name=vendor/[name].[hash].[ext]'
                    },
                    {
                        test: /\.html$/,
                        loader: 'raw',
                        exclude: /index.html$/
                    }
                ]
            };

            config.postcss = [
                autoprefixer({
                    browsers: ['last 2 version', 'iOS 7']
                })
            ];

            config.plugins = [];
            config.plugins.push(
                    new HtmlWebpackPlugin({
                        template: developmentPath + 'index.html',
                        inject: 'body',
                        metadata: METADATA,
                    }),
                    new ExtractTextPlugin('vendor/[name].[hash].css', {disable: !isProd, allChunks: true})
            );

            if (isNative) {
                config.plugins.push( new CordovaPlugin({
                            config: cordovaPath + 'config.xml',  // Location of Cordova' config.xml (will be created if not found)
                            src: 'index.html',     // Set entry-point of cordova in config.xml
                            platform: 'windows',// (or 'android') // Set `webpack-dev-server` to correct `contentBase` to use Cordova plugins.
                            version: true,         // Set config.xml' version. (true = use version from package.json)
                        })
                );
            }
            if (isProd || isNative) {
                config.plugins.push(
                        new ngAnnotatePlugin({
                            add: true
                        }),
                        new webpack.NoErrorsPlugin(),
                        new webpack.optimize.DedupePlugin(),
                        new webpack.optimize.UglifyJsPlugin(),
                        new CopyWebpackPlugin([{
                            from: developmentPath + 'public'
                        }]),
                        new OfflinePlugin()
                )
            }

            config.devServer = {
                contentBase: developmentPath + 'public/',
                stats: 'minimal',
                port: 4200,
                proxy: {
                    '*': 'http://localhost:8080/'
                },
                host: '0.0.0.0'
            };

            return config;
        }();

    What is worth noting, is that building and deploying for Android app works good.
    Anyone knows what can be wrong with my configs?                                                               

    Sunday, May 7, 2017 7:30 PM