-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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: handle path with dollar signs #1732
Conversation
I really doubt this makes any difference at all. I created a project with $$ in its path, and also tried a package with $$ in its name, both are working fine (as long as no Yarn 2 is involved). |
The replacement value cannot be a function. It also has nothing to do with native |
I think you're incorrect ... I literally just followed your website's getting started:
I see "Hello Vite!". I then run (note the quotes around
Navigating to localhost yields an empty page and a 404 error. Just to double-check I then do a last test:
The "Hello Vue!" appears again. In other word, the |
The The diff @merceyz's nicely made aims to prevent this behavior, which causes the breakages with Honestly, even if you don't repro the problem (and I think you should be able to fairly easily), it's easy to see what kind of problems the current code is susceptible to. |
It's passed into https://github.com/rollup/plugins/blob/f75d5a7fff89bff5f3d59cb268926337b709598a/packages/alias/src/index.ts#L106 and per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#parameters it can be a function, if it goes anywhere else I missed please, do tell |
Ah, ok, this only happens if |
Thanks for the fix! The windows CI is failing because of unrelated commits. |
That's what I said in the PR description (and why I applied the change to the
No worries, if you run into issues concerning Yarn PnP please don't hessitate to ping us 👍 |
What's the problem this PR addresses?
Vite doesn't work when the path it is in contains dollar signs
Fixes #1423
Ref https://twitter.com/youyuxi/status/1354094331876016134
How did you fix it?
Use the callback version of
.replace
.More
This should be handled correctly in all places that uses
.replace
(for examplevite/packages/vite/src/node/plugins/clientInjections.ts
Lines 43 to 51 in 1e67d66