diff --git a/webpack.common.js.angular.template b/webpack.common.js.angular.template index db63b2ed..ec7934ae 100644 --- a/webpack.common.js.angular.template +++ b/webpack.common.js.angular.template @@ -19,17 +19,19 @@ module.exports = function (platform, destinationApp) { // app.css bundle entry["app.css"] = "./app.css"; + // Vendor libs go to the vendor.js chunk + var commonsChunkNames = ["vendor"]; + + // Compatibility workaround with NativeScript 2.5 Android runtime + // https://github.com/NativeScript/NativeScript/issues/3947 + if (platform === "android") { + commonsChunkNames.push("tns-java-classes"); + } + var plugins = [ new ExtractTextPlugin("app.css"), new webpack.optimize.CommonsChunkPlugin({ - name: [ - // Vendor libs go to the vendor.js chunk - "vendor", - - // Compatibility workaround with NativeScript 2.5 Android runtime - // https://github.com/NativeScript/NativeScript/issues/3947 - "tns-java-classes", - ], + name: commonsChunkNames }), // Define useful constants like TNS_WEBPACK new webpack.DefinePlugin({ diff --git a/webpack.common.js.javascript.template b/webpack.common.js.javascript.template index ef12157c..30dc3f2a 100644 --- a/webpack.common.js.javascript.template +++ b/webpack.common.js.javascript.template @@ -18,18 +18,19 @@ module.exports = function (platform, destinationApp) { // app.css bundle entry["app.css"] = "./app.css"; + // Vendor libs go to the vendor.js chunk + var commonsChunkNames = ["vendor"]; + + // Compatibility workaround with NativeScript 2.5 Android runtime + // https://github.com/NativeScript/NativeScript/issues/3947 + if (platform === "android") { + commonsChunkNames.push("tns-java-classes"); + } + var plugins = [ new ExtractTextPlugin("app.css"), - // Vendor libs go to the vendor.js chunk new webpack.optimize.CommonsChunkPlugin({ - name: [ - // Vendor libs go to the vendor.js chunk - "vendor", - - // Compatibility workaround with NativeScript 2.5 Android runtime - // https://github.com/NativeScript/NativeScript/issues/3947 - "tns-java-classes", - ], + name: commonsChunkNames }), // Define useful constants like TNS_WEBPACK new webpack.DefinePlugin({ diff --git a/webpack.common.js.typescript.template b/webpack.common.js.typescript.template index fffc37c8..f46f8dfd 100644 --- a/webpack.common.js.typescript.template +++ b/webpack.common.js.typescript.template @@ -18,18 +18,19 @@ module.exports = function (platform, destinationApp) { // app.css bundle entry["app.css"] = "./app.css"; + // Vendor libs go to the vendor.js chunk + var commonsChunkNames = ["vendor"]; + + // Compatibility workaround with NativeScript 2.5 Android runtime + // https://github.com/NativeScript/NativeScript/issues/3947 + if (platform === "android") { + commonsChunkNames.push("tns-java-classes"); + } + var plugins = [ new ExtractTextPlugin("app.css"), - // Vendor libs go to the vendor.js chunk new webpack.optimize.CommonsChunkPlugin({ - name: [ - // Vendor libs go to the vendor.js chunk - "vendor", - - // Compatibility workaround with NativeScript 2.5 Android runtime - // https://github.com/NativeScript/NativeScript/issues/3947 - "tns-java-classes", - ], + name: commonsChunkNames }), // Define useful constants like TNS_WEBPACK new webpack.DefinePlugin({