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

2.5.0-beta fails to works with resolve.alias #4511

Closed
7 tasks done
ghost opened this issue Aug 5, 2021 · 7 comments
Closed
7 tasks done

2.5.0-beta fails to works with resolve.alias #4511

ghost opened this issue Aug 5, 2021 · 7 comments

Comments

@ghost
Copy link

ghost commented Aug 5, 2021

Describe the bug

Having resolve.alias breaks dev on Win10
(was working on 2.4.4)

2021-08-05_093801

Reproduction

https://github.com/web2033/vite-2.5.0-beta-bug

System Info

Win 10

Used Package Manager

npm

Logs

No response

Validations

@ghost ghost added the pending triage label Aug 5, 2021
@ygj6
Copy link
Member

ygj6 commented Aug 5, 2021

Issues caused by upgrading @rollup/plugin-alias from 3.1.4 to 3.1.5,but I think vite has a problem with alias handling and I am fixing it.

@ghost
Copy link
Author

ghost commented Aug 5, 2021

This? rollup/plugins#896

@ygj6
Copy link
Member

ygj6 commented Aug 5, 2021

Yes, you can go back to @rollup/[email protected] The issue does not exist
image

@rollup/[email protected] keep the window drive letter

@ygj6
Copy link
Member

ygj6 commented Aug 5, 2021

Because @rollup/[email protected] will delete the window drive letter, D:\src will become \src
but @rollup/[email protected] retains the window drive letter, so path.resolve(__dirname,'/src') this kind of wrong path is no longer supported, there is no issue with vite processing,
we need to pass the correct path path.resolve(__dirname,'src'), works normally.

@ghost
Copy link
Author

ghost commented Aug 5, 2021

That worked.
So starting from 2.5.0 I need to remove that extra /?

@patak-dev
Copy link
Member

Good catch @ygj6, I hope this doesn't break others. I don't know if we can do much here.

@ygj6
Copy link
Member

ygj6 commented Aug 5, 2021

path.resolve(__dirname,'/src') is a wrong path, not the real project root path, so I don’t think Vite should do anything.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants