vuejs2 - 使用nuxt时可以关闭热重载吗?

标签 vuejs2 nuxt.js

我使用以下命令启动了我的 vue/nuxt 应用程序:

npx create-nuxt-app 
我想在运行开发服务器时关闭热重载功能。我在任何地方都找不到这样做的选项。在 nuxt 命令的帮助中,有:
nuxt --help
    Description
      Starts the application in development mode (hot-code reloading, error
      reporting, etc)
    Usage
      $ nuxt dev <dir> -p <port number> -H <hostname>
    Options
      --port, -p          A port number on which to start the application
      --hostname, -H      Hostname on which to start the application
      --spa               Launch in SPA mode
      --universal         Launch in Universal mode (default)
      --config-file, -c   Path to Nuxt.js config file (default: nuxt.config.js)
      --help, -h          Displays this message
没有关闭热重载的开关。我认为在 nuxt.config.js 中可能是可能的文件,但我一直无法找到可能的选项。
我已经浏览了从这个页面开始的文档:https://nuxtjs.org/api/configuration-build但我没有看到。

最佳答案

不是下面的完美解决方案,但至少它停止了热重载。

对于使用 Webpack 3 和 Chrome (67.0.3396.99) DevTools 的 Nuxt 1.4.0:

  • 在 Chrome 中打开开发者工具
  • 单击右上角的三个点 (...)
  • 点击更多工具 -> 请求阻止
  • 单击“启用请求阻止”并添加“*hot-update.json”

  • enter image description here

    这将停止热重载 - 但也会抛出错误消息。

    可能会帮助某人 - 它为我做到了:)

    关于vuejs2 - 使用nuxt时可以关闭热重载吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48252719/

    相关文章:

    css - 无法在 VueJs 应用程序中导入 css(Webpack 错误)

    javascript - 在单输入中进行 Markdown 更新

    vue.js - 如何在 Nuxt 3 中添加一个脚本 block 到头部?

    vue.js - Vuex - 不要在突变处理程序之外改变 vuex 存储状态

    javascript - nuxt-links 导航到带有哈希/ anchor 的页面的问题

    javascript - 当父数据更改时,VueJS 子组件不会更新

    javascript - Vue.js : Element is shown for a moment despite of conditional rendering

    javascript - VueJS - 如何检查匹配值的数组?

    javascript - 使用 Express 的 Nuxt 应用程序不允许在应用程序外部访问 POST 路由

    javascript - NUXT - SSR - 组件未在服务器端呈现