ice icon indicating copy to clipboard operation
ice copied to clipboard

移动端配置代理之后热更新失败

Open onethingwxy opened this issue 1 year ago • 1 comments

Describe the bug

开发移动端项目,真机调试配置代理到电脑上之后,页面无法热更新 image

Expected behavior

希望可以解决这个问题或者是提供开关关闭热更新

Actual behavior

No response

Version of ice.js

3.4.8

Content of build.json or ice.config.mts

import { defineConfig } from "@ice/app";
import request from "@ice/plugin-request";
import store from "@ice/plugin-store";

// The project config, see https://v3.ice.work/docs/guide/basic/config
const minify = process.env.NODE_ENV === "production" ? "swc" : false;
export default defineConfig(() => ({
  ssg: false,
  // hash: "contenthash",
  compileDependencies: false,
  minify,
  server: {
    onDemand: true,
    format: "esm",
  },
  plugins: [request(), store()],
  postcss: {
    plugins: ["tailwindcss"],
  },
  dropLogLevel: false,
  routes: {
    // 忽略 src/pages 下所有 components 目录
    ignoreFiles: ["**/components/**"],
  },
}));

Additional context

No response

onethingwxy avatar May 24 '24 02:05 onethingwxy

热更新依赖 websocket 服务,需要确认你的代理配置有没有处理好

ClarkXia avatar May 24 '24 02:05 ClarkXia

热更新依赖 websocket 服务,需要确认你的代理配置有没有处理好

我的代理没问题,我是把手机代理到电脑上然后通过https访问的开发环境页面,和这个一样的问题#4260, 但是好像一直没解决?

onethingwxy avatar May 27 '24 03:05 onethingwxy

走代理的情况下,可以参考 https://webpack.js.org/configuration/dev-server/#websocketurl 的设置

ClarkXia avatar Jun 27 '24 07:06 ClarkXia