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: composes on windows #135

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

sapphi-red
Copy link
Contributor

This PR fixes composes from '...' not working on windows.
The tests are already covered so I just enabled github actions with Windows.

refs css-modules/css-modules-loader-core#16, vitejs/vite#3092

Comment on lines +47 to +53
if (root === '/' && process.platform === "win32") {
const cwdDrive = process.cwd().slice(0, 3)
if (!/^[A-Z]:\\$/.test(cwdDrive)) {
throw new Error(`Failed to obtain root from "${process.cwd()}".`)
}
root = cwdDrive
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added these lines here instead of getLoader to avoid a breaking change.

const root = typeof opts.root === "undefined" ? "/" : opts.root;

@davbrito
Copy link

Hi. What's the status of this? Will this be merged?

@madyankin madyankin merged commit acb6a82 into madyankin:master Aug 15, 2022
@sapphi-red sapphi-red deleted the fix/composes-windows branch August 18, 2022 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants