Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

fix targetPath regexp #139

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

samnight
Copy link

Directory name includes query params while generating route, but it shouldn't.

lib/index.js Outdated
@@ -212,7 +212,7 @@ class Ream extends Event {
const html = await this.renderer.renderToString(context)
const { start, end } = await renderTemplate(context)
const targetPath = this.resolveOutDir(
`generated/${route.replace(/\/?$/, '/index.html')}`
`generated/${route.replace(/(\/?$|\/?\?.*$)/, '/index.html')}`
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't it rather be something like /\/?(\?.*)?$/

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I will fix it.

@IlyaSemenov
Copy link
Contributor

@egoist I never worked with ream generator, please advise if the PR makes sense?

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

Successfully merging this pull request may close these issues.

None yet

2 participants