0

我正在使用带有 TypeScript 的 Snowpack、React 和 MobX。

当 React 组件发生变化时,HMR 就会启动,一切都运行良好。但是,当商店发生变化时,我会收到一条消息,hmr-client说有更新,但实际上什么也没发生。

[ESM-HMR] message: update {type: "update", url: "/stores/setupContext.js", bubbled: true}

那是我的雪包配置-

module.exports = {
  root: './src',
  workspaceRoot: './../../',
  routes: [{ match: 'routes', src: '.*', dest: '/index.html' }],
  mount: {
    public: { url: '/', static: true },
    src: '/',
  },
  plugins: [
    '@snowpack/plugin-typescript',
    '@snowpack/plugin-dotenv',
    '@snowpack/plugin-react-refresh',
    /* ... */
  ],
  packageOptions: {
    knownEntrypoints: ['emotion-theming'],
    /* ... */
  },
  devOptions: {
    port: 6100,
  },
  buildOptions: {
    /* ... */
  },
};

不在项目中使用装饰器。任何想法/帮助都会很棒。

4

0 回答 0