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(dev): remove comment for dynamic import inside server rewrite #1001

Merged
merged 2 commits into from Nov 2, 2020

Conversation

@underfin
Copy link
Contributor

@underfin underfin commented Nov 2, 2020

fix #998

// #998 remove comment
id = id.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm, '')
// remove spaces
id = id.replace(/\s/g, '')

This comment has been minimized.

@yyx990803

yyx990803 Nov 2, 2020
Contributor

I think this line can be removed by changing the match regex below to account for potential spaces

// #998 remove comment
id = id.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm, '')
// remove spaces
id = id.replace(/\s/g, '')
const literalIdMatch = id.match(/^(?:'([^']+)'|"([^"]+)")$/)

This comment has been minimized.

@yyx990803

yyx990803 Nov 2, 2020
Contributor

Suggested change
const literalIdMatch = id.match(/^(?:'([^']+)'|"([^"]+)")$/)
const literalIdMatch = id.match(/^\s*(?:'([^']+)'|"([^"]+)")\s*$/)
@yyx990803 yyx990803 merged commit 4ccff7a into vitejs:master Nov 2, 2020
2 checks passed
2 checks passed
ci/circleci: test Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@underfin underfin deleted the underfin:remove-comment-dynamic-import branch Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.