bluwy / whyframe

Develop components in isolation with just an iframe

Home Page:https://whyframe.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plugins fail on Windows

qinyouzhi opened this issue · comments

Inconsistent path addresses between Mac and Windows (Mac:/ Windows: ), resulting in plugin failure on Windows

Inconsistent path addresses between Mac and Windows (Mac:/ Windows: \), resulting in plugin failure on Windows

I don't have a windows machine to test out, and the issue description is vague. Can you further elaborate the issue you're seeing?

In @whyframe/jsx/src/docusaurus.cjs, the matching rule for rule @docusaurus/mdx-loader in Windows is actually @Docusaurus\mdx-loader, which causes the loader to fail to mount

There is also an issue with the 'this. resource' in loader.cjs. Change it to path.relative(__dirname, this.resource).split(path.sep).join('/') and run it

Sorry for the late reply, thanks for digging into this!

  1. The changes for @docusaurus/mdx-loader sounds good to me.
  2. For this.resource, maybe it's better to use this.resourcePath instead? Would be great if you can test if this works.

Feel free to send a PR for the two changes too. Don't think we need tests for those for now, I should update CI to also run them in Windows.