Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7f446de

Browse files
committedNov 7, 2018
updated resources
1 parent e4131c6 commit 7f446de

File tree

26 files changed

+31
-6
lines changed

26 files changed

+31
-6
lines changed
 

‎demo/JavaScriptApp/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"version": "next"
1010
},
1111
"tns-android": {
12-
"version": "next"
12+
"version": "5.0.0-2018-11-05-171453-02"
1313
}
1414
},
1515
"dependencies": {
@@ -29,11 +29,11 @@
2929
"mocha-multi": "^0.11.0",
3030
"nativescript-dev-appium": "next",
3131
"nativescript-dev-sass": "next",
32-
"nativescript-dev-webpack": "next",
32+
"nativescript-dev-webpack": "^0.18.0-2018-11-05-214332-01",
3333
"node-sass": "^4.7.1"
3434
},
3535
"scripts": {
3636
"setup": "npm pack ../../ && npm i -D nativescript-dev-webpack*.tgz",
3737
"e2e": "mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json"
3838
}
39-
}
39+
}

‎demo/JavaScriptApp/webpack.config.js

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ module.exports = env => {
4141
uglify, // --env.uglify
4242
report, // --env.report
4343
sourceMap, // --env.sourceMap
44+
hmr, // --env.hmr,
4445
} = env;
46+
const externals = (env.externals || []).map((e) => { // --env.externals
47+
return new RegExp(e + ".*");
48+
});
4549

4650
const appFullPath = resolve(projectRoot, appPath);
4751
const appResourcesFullPath = resolve(projectRoot, appResourcesPath);
@@ -52,6 +56,7 @@ module.exports = env => {
5256
const config = {
5357
mode: uglify ? "production" : "development",
5458
context: appFullPath,
59+
externals,
5560
watchOptions: {
5661
ignored: [
5762
appResourcesFullPath,
@@ -116,9 +121,9 @@ module.exports = env => {
116121
minimize: !!uglify,
117122
minimizer: [
118123
new UglifyJsPlugin({
124+
parallel: true,
125+
cache: true,
119126
uglifyOptions: {
120-
parallel: true,
121-
cache: true,
122127
output: {
123128
comments: false,
124129
},
@@ -152,6 +157,21 @@ module.exports = env => {
152157
].filter(loader => !!loader)
153158
},
154159

160+
{
161+
test: /-page\.js$/,
162+
use: "nativescript-dev-webpack/script-hot-loader"
163+
},
164+
165+
{
166+
test: /\.(css|scss)$/,
167+
use: "nativescript-dev-webpack/style-hot-loader"
168+
},
169+
170+
{
171+
test: /\.(html|xml)$/,
172+
use: "nativescript-dev-webpack/markup-hot-loader"
173+
},
174+
155175
{ test: /\.(html|xml)$/, use: "nativescript-dev-webpack/xml-namespace-loader"},
156176

157177
{
@@ -165,7 +185,7 @@ module.exports = env => {
165185
{ loader: "css-loader", options: { minimize: false, url: false } },
166186
"sass-loader"
167187
]
168-
}
188+
},
169189
]
170190
},
171191
plugins: [
@@ -229,5 +249,10 @@ module.exports = env => {
229249
}));
230250
}
231251

252+
if (hmr) {
253+
config.plugins.push(new webpack.HotModuleReplacementPlugin());
254+
}
255+
256+
232257
return config;
233258
};

0 commit comments

Comments
 (0)
This repository has been archived.