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

fixed build vite-plugin on windows (fix #473) #474

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GoodSimonVM
Copy link

It's build now, but pnpm run test has a lot of errors. I think it's because path.posix is used in tests, but I don't know much about testing.

- replace path.posix imports to path imports
- fix path resolving in bundle client code
@changeset-bot
Copy link

changeset-bot bot commented Aug 19, 2022

⚠️ No Changeset found

Latest commit: 115a1a2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Aug 19, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
vite-plugin-docs ⬜️ Ignored (Inspect) Aug 19, 2022 at 0:36AM (UTC)

@jacksteamdev
Copy link
Contributor

jacksteamdev commented Aug 21, 2022

@GoodSimonVM Thanks for this PR! I really want to support development on Windows and this looks like the right direction.

Rollup/Vite use posix internally, and in a previous version of CRXJS, we needed to use posix to support certain Rollup/Vite features.

The CI tests are passing on Mac/Linux, but this could be a breaking change for certain Vite settings, so I'm nervous about merging this without more thorough testing.

I will set aside some time to test this in a real project, but my open-source time is limited right now, so it may take a few weeks.

@jacebenson
Copy link

Is there anyway I can help with this?

@linonetwo
Copy link

I encounter this, how to workaround?

@linonetwo
Copy link

Manually replace import { posix } from 'path';

with

import {
  basename,
  dirname,
  extname,
  delimiter,
  format,
  isAbsolute,
  join,
  normalize,
  parse,
  relative,
  resolve,
  toNamespacedPath,
  sep
} from 'path';

图片

@jacksteamdev jacksteamdev added vite-plugin Related to Vite plugin windows Windows compatibility issue labels Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vite-plugin Related to Vite plugin windows Windows compatibility issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants