Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

[BUG]更新至2.9.0的一些bug #1383

Closed
juvham opened this issue Nov 26, 2020 · 1 comment
Closed

[BUG]更新至2.9.0的一些bug #1383

juvham opened this issue Nov 26, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@juvham
Copy link
Contributor

juvham commented Nov 26, 2020

bug 描述

更新至2.9.0 web bug

  1. public放置的 index.html模版失效
    2.进入首页就加载了全部页面的js
    3.build web 生产模式 会出现react is not defined 报错

复现步骤

使用命令行工具创建一个新项目,把remax版本更新至2.9.0

期望结果

  1. public 里的模版会生效。或着提供别的使用模版的方式
  2. 进入页面只加载当前页面依赖的js
  3. 从任意path 进入页面能正常访问
  4. 修复该错误

复现代码
[请提供一个可复现问题的代码仓库]

版本信息:

  • remax 版本: 2.9.0
  • react 版本: 17.0.1

只访问了首页加载了全部的JS文件
image

production mode 报错
image

@juvham juvham added the bug Something isn't working label Nov 26, 2020
@juvham juvham changed the title [BUG] [BUG]更新至2.9.0的一些bug Nov 26, 2020
@juvham
Copy link
Contributor Author

juvham commented Nov 26, 2020

build web 生产模式 会出现react is not defined 报错
原因:

  if (process.env.NODE_ENV === 'production') {
    config.externals({
      react: 'React',
      'react-dom': 'ReactDOM',
    });
  }

juvham pushed a commit to MatrixEmpire/remax that referenced this issue Nov 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant