Nativescript-vue无法实时更新 [英] Nativescript-vue Not Live Updating

查看:121
本文介绍了Nativescript-vue无法实时更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾经运行命令:tns run android --bundle.当我保存更改时,它们会在物理和虚拟android仿真器中自动更新.

I used to run the command : tns run android --bundle. And when i saved the changes, they were automatically updated in the physical and virtual android emulators.

现在,当我保存更改时,什么也没有发生,必须再次运行命令以查看更改.

Now when i save the changes, nothing happens and have to run the command again to see the changes.

当我保存项目时,它会显示以下消息:

When i save the project, it appears the following message:

File change detected. Starting incremental webpack compilation...
Hash: 2e482eb5460af6f4127a
Version: webpack 4.27.1
Time: 1119ms
Built at: 12/04/2019 11:31:32 AM
                                    Asset      Size   Chunks             Chunk Names
     a3a53c6e399658f9e1f5.hot-update.json  48 bytes           [emitted]
bundle.a3a53c6e399658f9e1f5.hot-update.js  10.1 KiB   bundle  [emitted]  bundle
                                bundle.js   892 KiB   bundle  [emitted]  bundle
                               runtime.js  71.4 KiB  runtime  [emitted]  runtime
 + 1 hidden asset
Entrypoint bundle = runtime.js vendor.js bundle.js bundle.a3a53c6e399658f9e1f5.hot-update.js
[../node_modules/nativescript-dev-webpack/style-hot-loader.js!../node_modules/nativescript-dev-webpack/apply-css-loader.js!../node_modules/css-loader/dist/cjs.js?!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/vue-loader/lib/index.js?!./pages/VistaPrueba.vue?vue&type=style&index=0&id=f4390c96&scoped=true&lang=css&] ../node_modules/nativescript-dev-webpack/style-hot-loader.js!../node_modules/nativescript-dev-webpack/apply-css-loader.js!../node_modules/css-loader/dist/cjs.js??ref--1-2!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/vue-loader/lib??vue-loader-options!./pages/VistaPrueba.vue?vue&type=style&index=0&id=f4390c96&scoped=true&lang=css& 1.26 KiB {bundle} [built]
[../node_modules/ts-loader/index.js?!../node_modules/vue-loader/lib/index.js?!./pages/VistaPrueba.vue?vue&type=script&lang=ts&] ../node_modules/ts-loader??ref--4!../node_modules/vue-loader/lib??vue-loader-options!./pages/VistaPrueba.vue?vue&type=script&lang=ts& 1.12 KiB {bundle} [built]
[../node_modules/vue-loader/lib/loaders/templateLoader.js?!../node_modules/vue-loader/lib/index.js?!./pages/VistaPrueba.vue?vue&type=template&id=f4390c96&scoped=true&] ../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../node_modules/vue-loader/lib??vue-loader-options!./pages/VistaPrueba.vue?vue&type=template&id=f4390c96&scoped=true& 5.58 KiB {bundle} [built]
[./ sync ^\.\/app\.(css|scss|less|sass)$] . sync nonrecursive ^\.\/app\.(css|scss|less|sass)$ 175 bytes {bundle} [built]
[./ sync recursive (?<!\bApp_Resources\b.*)\.(xml|css|js|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$] . sync (?<!\bApp_Resources\b.*)\.(xml|css|js|(?<!\.d\.)ts|(?<!\b_[\w-]*\.)scss)$ 558 bytes {bundle} [built]
[./pages/VistaPrueba.vue] 1.21 KiB {bundle} [built]
[./routes.ts] 2.57 KiB {bundle} [built]
    + 418 hidden modules
Webpack compilation complete. Watching for file changes.
Webpack build done!

推荐答案

NativeScript CLI中存在一些错误,阻止了热模块重载(HMR),该错误应刷新模拟器中的应用程序.

There were some bugs in the NativeScript CLI which prevents the Hot Module Reload (HMR) which should refresh the application in your emulators.

一种快速的解决方法是运行命令:

A quick fix is to run the command:

tns run android --no-hmr

实际上可以完全重新启动/重新加载应用程序.

Which practically restarts/reloads the application completely.

这篇关于Nativescript-vue无法实时更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆