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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/vite-plugin/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import resolve from '@rollup/plugin-node-resolve'
import _debug from 'debug'
import fs from 'fs-extra'
import jsesc from 'jsesc'
import { posix as path } from 'path'
import path from 'path'
import { defineConfig, Plugin, rollup, RollupOptions } from 'rollup'
import esbuild from 'rollup-plugin-esbuild'
import dts from 'rollup-plugin-dts'
Expand Down Expand Up @@ -44,7 +44,9 @@ const bundleClientCode = (): Plugin => {
if (id.includes('?client')) {
const url = new URL(id, 'stub://stub')
const filepath = url.pathname
const format = path.dirname(filepath).split('/').pop() as
const normalizedFilepath = path.normalize(filepath);
const dirname = path.dirname(normalizedFilepath);
const format = dirname.split(path.sep).pop() as
| 'es'
| 'iife'
| 'html'
Expand Down
4 changes: 2 additions & 2 deletions packages/vite-plugin/src/node/path.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { posix } from 'path'
import path from 'path'

export const {
basename,
Expand All @@ -14,4 +14,4 @@ export const {
resolve,
toNamespacedPath,
sep,
} = posix
} = path