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

fix: router replace don't work with dynamic routes in windows #402

Merged
merged 1 commit into from
May 9, 2018

Conversation

boxcc
Copy link
Contributor

@boxcc boxcc commented Apr 27, 2018

fix #401

@coveralls
Copy link

coveralls commented Apr 27, 2018

Pull Request Test Coverage Report for Build 270

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.002%) to 4.633%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/umi-build-dev/src/FilesGenerator.js 0 1 0.0%
Totals Coverage Status
Change from base Build 269: -0.002%
Covered Lines: 80
Relevant Lines: 1760

💛 - Coveralls

@@ -203,7 +203,7 @@ if (process.env.NODE_ENV === 'production') {
return tplContent
.replace(PLACEHOLDER_IMPORT, '')
.replace(PLACEHOLDER_ROUTER_MODIFIER, '')
.replace('<%= ROUTES %>', routes)
.replace('<%= ROUTES %>', () => routes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没能理解为啥 () => routes 就好了。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为 $' 为replace的特殊字符

返回一个function 就不作为特殊字符处理

@xiaohuoni
Copy link
Member

#441

@sorrycc sorrycc changed the title fix build router replace bug fix: router replace don't work with dynamic routes in windows May 9, 2018
@sorrycc sorrycc merged commit 6a4c2e7 into umijs:master May 9, 2018
xierenyuan pushed a commit to xierenyuan/umi that referenced this pull request Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

运行npm run build 报错
4 participants