Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
onethingwxy opened this issue May 24, 2024 · 3 comments
Closed

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

onethingwxy opened this issue May 24, 2024 · 3 comments
Labels

Comments

@onethingwxy
Copy link

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

@ClarkXia
Copy link
Collaborator

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

@onethingwxy
Copy link
Author

onethingwxy commented May 27, 2024

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

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

@ClarkXia
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants