Skip to content

Commit 18479f5

Browse files
chore: update deps
1 parent 1745a6c commit 18479f5

File tree

5 files changed

+29
-27
lines changed

5 files changed

+29
-27
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ hooks/
66
*/**/*.js
77
*/**/*.js.map
88
/package-lock.json
9-
mochawesome-report
9+
mochawesome-report
10+
verify-report

package.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
"readme": "NativeScript Application",
55
"repository": "<fill-your-repository-here>",
66
"nativescript": {
7-
"id": "org.nativescript.BkgdExecExample"
7+
"id": "org.nativescript.BkgdExecExample",
8+
"tns-ios": {
9+
"version": "next"
10+
}
811
},
912
"dependencies": {
10-
"tns-core-modules": "latest"
13+
"tns-core-modules": "next"
1114
},
1215
"devDependencies": {
1316
"@types/chai": "~4.1.7",
@@ -16,13 +19,15 @@
1619
"mocha": "~5.2.0",
1720
"mochawesome": "~3.1.2",
1821
"nativescript-dev-appium": "next",
19-
"nativescript-dev-typescript": "latest",
20-
"nativescript-dev-webpack": "latest",
21-
"tns-platform-declarations": "latest",
22+
"nativescript-dev-typescript": "^0.9.0",
23+
"nativescript-dev-webpack": "next",
24+
"tns-platform-declarations": "next",
2225
"typescript": "^3.1.1"
2326
},
2427
"scripts": {
2528
"e2e": "tsc -p e2e && mocha --opts ./e2e/config/mocha.opts",
26-
"e2e-watch": "tsc -p e2e --watch"
29+
"e2e-watch": "tsc -p e2e --watch",
30+
"ns-verify-bundle": "ns-verify-bundle",
31+
"update-ns-webpack": "update-ns-webpack"
2732
}
28-
}
33+
}

tsconfig.esm.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

tsconfig.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
"paths": {
1515
"~/*": [
1616
"app/*"
17-
],
18-
"*": [
19-
"./node_modules/tns-core-modules/*",
20-
"./node_modules/*"
2117
]
2218
}
2319
},

webpack.config.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const CleanWebpackPlugin = require("clean-webpack-plugin");
77
const CopyWebpackPlugin = require("copy-webpack-plugin");
88
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
99
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
10-
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
10+
const TerserPlugin = require("terser-webpack-plugin");
1111
const hashSalt = Date.now().toString();
1212

1313
module.exports = env => {
@@ -41,21 +41,25 @@ module.exports = env => {
4141
uglify, // --env.uglify
4242
report, // --env.report
4343
sourceMap, // --env.sourceMap
44+
hiddenSourceMap, // --env.hiddenSourceMap
4445
hmr, // --env.hmr,
4546
unitTesting, // --env.unitTesting
4647
} = env;
48+
const isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;
4749
const externals = nsWebpack.getConvertedExternals(env.externals);
4850

4951
const appFullPath = resolve(projectRoot, appPath);
5052
const appResourcesFullPath = resolve(projectRoot, appResourcesPath);
5153

52-
const entryModule = nsWebpack.getEntryModule(appFullPath);
54+
const entryModule = nsWebpack.getEntryModule(appFullPath, platform);
5355
const entryPath = `.${sep}${entryModule}.ts`;
5456
const entries = { bundle: entryPath };
5557
if (platform === "ios") {
5658
entries["tns_modules/tns-core-modules/inspector_modules"] = "inspector_modules.js";
5759
};
5860

61+
let sourceMapFilename = nsWebpack.getSourceMapFilename(hiddenSourceMap, __dirname, dist);
62+
5963
const config = {
6064
mode: uglify ? "production" : "development",
6165
context: appFullPath,
@@ -72,6 +76,7 @@ module.exports = env => {
7276
output: {
7377
pathinfo: false,
7478
path: dist,
79+
sourceMapFilename,
7580
libraryTarget: "commonjs2",
7681
filename: "[name].js",
7782
globalObject: "global",
@@ -104,7 +109,7 @@ module.exports = env => {
104109
"fs": "empty",
105110
"__dirname": false,
106111
},
107-
devtool: sourceMap ? "inline-source-map" : "none",
112+
devtool: hiddenSourceMap ? "hidden-source-map" : (sourceMap ? "inline-source-map" : "none"),
108113
optimization: {
109114
runtimeChunk: "single",
110115
splitChunks: {
@@ -124,12 +129,14 @@ module.exports = env => {
124129
},
125130
minimize: !!uglify,
126131
minimizer: [
127-
new UglifyJsPlugin({
132+
new TerserPlugin({
128133
parallel: true,
129134
cache: true,
130-
uglifyOptions: {
135+
sourceMap: isAnySourceMapEnabled,
136+
terserOptions: {
131137
output: {
132138
comments: false,
139+
semicolons: !isAnySourceMapEnabled
133140
},
134141
compress: {
135142
// The Android SBG has problems parsing the output
@@ -183,13 +190,13 @@ module.exports = env => {
183190

184191
{
185192
test: /\.css$/,
186-
use: { loader: "css-loader", options: { minimize: false, url: false } }
193+
use: { loader: "css-loader", options: { url: false } }
187194
},
188195

189196
{
190197
test: /\.scss$/,
191198
use: [
192-
{ loader: "css-loader", options: { minimize: false, url: false } },
199+
{ loader: "css-loader", options: { url: false } },
193200
"sass-loader"
194201
]
195202
},
@@ -202,7 +209,7 @@ module.exports = env => {
202209
configFile: "tsconfig.tns.json",
203210
allowTsInNodeModules: true,
204211
compilerOptions: {
205-
sourceMap
212+
sourceMap: isAnySourceMapEnabled
206213
}
207214
},
208215
}

0 commit comments

Comments
 (0)