Skip to content

fix: composes on windows#135

Merged
madyankin merged 1 commit intomadyankin:masterfrom
sapphi-red:fix/composes-windows
Aug 15, 2022
Merged

fix: composes on windows#135
madyankin merged 1 commit intomadyankin:masterfrom
sapphi-red:fix/composes-windows

Conversation

@sapphi-red
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@sapphi-red sapphi-red May 23, 2022

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
Copy Markdown

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.

3 participants