Skip to content

chore: update deps to ng 5.1 and ns webpack 0.9.1 #255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
}
},
"dependencies": {
"@angular/common": "~5.0.0",
"@angular/compiler": "~5.0.0",
"@angular/core": "~5.0.0",
"@angular/forms": "~5.0.0",
"@angular/http": "~5.0.0",
"@angular/platform-browser": "~5.0.0",
"@angular/platform-browser-dynamic": "~5.0.0",
"@angular/router": "~5.0.0",
"@angular/common": "~5.1.0",
"@angular/compiler": "~5.1.0",
"@angular/core": "~5.1.0",
"@angular/forms": "~5.1.0",
"@angular/http": "~5.1.0",
"@angular/platform-browser": "~5.1.0",
"@angular/platform-browser-dynamic": "~5.1.0",
"@angular/router": "~5.1.0",
"nativescript-angular": "next",
"nativescript-camera": "~3.1.2",
"nativescript-geolocation": "^4.1.1",
Expand All @@ -48,15 +48,15 @@
"zone.js": "^0.8.4"
},
"devDependencies": {
"@angular/compiler-cli": "~5.0.0",
"@ngtools/webpack": "~1.8.2",
"@angular/compiler-cli": "~5.1.0",
"@ngtools/webpack": "~1.9.1",
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.10.0",
"codelyzer": "^3.0.1",
"copy-webpack-plugin": "~4.0.1",
"copy-webpack-plugin": "~4.3.0",
"css-loader": "~0.28.7",
"extract-text-webpack-plugin": "~3.0.0",
"extract-text-webpack-plugin": "~3.0.2",
"fs-extra": "^0.30.0",
"glob": "^7.1.2",
"lazy": "1.0.11",
Expand All @@ -67,15 +67,16 @@
"nativescript-worker-loader": "~0.8.1",
"opener": "^1.4.1",
"raw-loader": "~0.5.1",
"resolve-url-loader": "~2.1.0",
"resolve-url-loader": "~2.2.1",
"rimraf": "^2.5.3",
"tar.gz": "^1.0.5",
"tns-platform-declarations": "^3.3.0",
"tslint": "^5.4.2",
"typescript": "~2.4.2",
"webpack": "~3.8.1",
"webpack-bundle-analyzer": "^2.8.2",
"webpack-sources": "~1.0.1"
"webpack": "~3.10.0",
"webpack-bundle-analyzer": "^2.9.1",
"webpack-sources": "~1.1.0",
"uglifyjs-webpack-plugin": "~1.1.6"
},
"scripts": {
"pretsc": "npm install",
Expand Down
29 changes: 22 additions & 7 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");

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

// tns-core-modules reads the app.css and its imports using css-loader
{ test: /\/app\.css$/, use: "css-loader?url=false" },
{ test: /\/app\.scss$/, use: ["css-loader?url=false", "sass-loader"] },
{
test: /[\/|\\]app\.css$/,
use: {
loader: "css-loader",
options: { minimize: false, url: false },
}
},
{
test: /[\/|\\]app\.scss$/,
use: [
{ loader: "css-loader", options: { minimize: false, url: false } },
"sass-loader"
]
},

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

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

// Work around an Android issue by setting compress = false
const compress = platform !== "android";
config.plugins.push(new webpack.optimize.UglifyJsPlugin({
mangle: { except: nsWebpack.uglifyMangleExcludes },
compress,
config.plugins.push(new UglifyJsPlugin({
uglifyOptions: {
mangle: { reserved: nsWebpack.uglifyMangleExcludes },
compress,
}
}));
}
return config;
Expand Down