Skip to content

Commit 1b5eff3

Browse files
authored
chore: update deps to ng 5.1 and ns webpack 0.9.1 (#255)
1 parent cf68669 commit 1b5eff3

File tree

2 files changed

+39
-23
lines changed

2 files changed

+39
-23
lines changed

package.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
}
3030
},
3131
"dependencies": {
32-
"@angular/common": "~5.0.0",
33-
"@angular/compiler": "~5.0.0",
34-
"@angular/core": "~5.0.0",
35-
"@angular/forms": "~5.0.0",
36-
"@angular/http": "~5.0.0",
37-
"@angular/platform-browser": "~5.0.0",
38-
"@angular/platform-browser-dynamic": "~5.0.0",
39-
"@angular/router": "~5.0.0",
32+
"@angular/common": "~5.1.0",
33+
"@angular/compiler": "~5.1.0",
34+
"@angular/core": "~5.1.0",
35+
"@angular/forms": "~5.1.0",
36+
"@angular/http": "~5.1.0",
37+
"@angular/platform-browser": "~5.1.0",
38+
"@angular/platform-browser-dynamic": "~5.1.0",
39+
"@angular/router": "~5.1.0",
4040
"nativescript-angular": "next",
4141
"nativescript-camera": "~3.1.2",
4242
"nativescript-geolocation": "^4.1.1",
@@ -48,15 +48,15 @@
4848
"zone.js": "^0.8.4"
4949
},
5050
"devDependencies": {
51-
"@angular/compiler-cli": "~5.0.0",
52-
"@ngtools/webpack": "~1.8.2",
51+
"@angular/compiler-cli": "~5.1.0",
52+
"@ngtools/webpack": "~1.9.1",
5353
"babel-traverse": "6.26.0",
5454
"babel-types": "6.26.0",
5555
"babylon": "6.10.0",
5656
"codelyzer": "^3.0.1",
57-
"copy-webpack-plugin": "~4.0.1",
57+
"copy-webpack-plugin": "~4.3.0",
5858
"css-loader": "~0.28.7",
59-
"extract-text-webpack-plugin": "~3.0.0",
59+
"extract-text-webpack-plugin": "~3.0.2",
6060
"fs-extra": "^0.30.0",
6161
"glob": "^7.1.2",
6262
"lazy": "1.0.11",
@@ -67,15 +67,16 @@
6767
"nativescript-worker-loader": "~0.8.1",
6868
"opener": "^1.4.1",
6969
"raw-loader": "~0.5.1",
70-
"resolve-url-loader": "~2.1.0",
70+
"resolve-url-loader": "~2.2.1",
7171
"rimraf": "^2.5.3",
7272
"tar.gz": "^1.0.5",
7373
"tns-platform-declarations": "^3.3.0",
7474
"tslint": "^5.4.2",
7575
"typescript": "~2.4.2",
76-
"webpack": "~3.8.1",
77-
"webpack-bundle-analyzer": "^2.8.2",
78-
"webpack-sources": "~1.0.1"
76+
"webpack": "~3.10.0",
77+
"webpack-bundle-analyzer": "^2.9.1",
78+
"webpack-sources": "~1.1.0",
79+
"uglifyjs-webpack-plugin": "~1.1.6"
7980
},
8081
"scripts": {
8182
"pretsc": "npm install",

webpack.config.js

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
77
const ExtractTextPlugin = require("extract-text-webpack-plugin");
88
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
99
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
10+
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
1011

1112
module.exports = env => {
1213
const platform = env && (env.android && "android" || env.ios && "ios");
@@ -60,12 +61,24 @@ module.exports = env => {
6061
{ test: /\.html$|\.xml$/, use: "raw-loader" },
6162

6263
// tns-core-modules reads the app.css and its imports using css-loader
63-
{ test: /\/app\.css$/, use: "css-loader?url=false" },
64-
{ test: /\/app\.scss$/, use: ["css-loader?url=false", "sass-loader"] },
64+
{
65+
test: /[\/|\\]app\.css$/,
66+
use: {
67+
loader: "css-loader",
68+
options: { minimize: false, url: false },
69+
}
70+
},
71+
{
72+
test: /[\/|\\]app\.scss$/,
73+
use: [
74+
{ loader: "css-loader", options: { minimize: false, url: false } },
75+
"sass-loader"
76+
]
77+
},
6578

6679
// Angular components reference css files and their imports using raw-loader
67-
{ test: /\.css$/, exclude: /\/app\.css$/, use: "raw-loader" },
68-
{ test: /\.scss$/, exclude: /\/app\.scss$/, use: ["raw-loader", "resolve-url-loader", "sass-loader"] },
80+
{ test: /\.css$/, exclude: /[\/|\\]app\.css$/, use: "raw-loader" },
81+
{ test: /\.scss$/, exclude: /[\/|\\]app\.scss$/, use: ["raw-loader", "resolve-url-loader", "sass-loader"] },
6982

7083
// Compile TypeScript files with ahead-of-time compiler.
7184
{ test: /.ts$/, use: [
@@ -139,9 +152,11 @@ module.exports = env => {
139152

140153
// Work around an Android issue by setting compress = false
141154
const compress = platform !== "android";
142-
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
143-
mangle: { except: nsWebpack.uglifyMangleExcludes },
144-
compress,
155+
config.plugins.push(new UglifyJsPlugin({
156+
uglifyOptions: {
157+
mangle: { reserved: nsWebpack.uglifyMangleExcludes },
158+
compress,
159+
}
145160
}));
146161
}
147162
return config;

0 commit comments

Comments
 (0)