Skip to content

Commit

Permalink
fix(windows): convertPathToPosix to relative
Browse files Browse the repository at this point in the history
  • Loading branch information
condorheroblog committed Nov 9, 2023
1 parent 214f602 commit c699ea3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vite-plugin-fake-server/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ export const vitePluginFakeServer = async (options: VitePluginFakeServerOptions
config.root,
);

const relativeFakeFilePath = fakeFilePath.map((filePath) => "/" + relative(config.root, filePath));
const relativeFakeFilePath = fakeFilePath.map((filePath) =>
convertPathToPosix("/" + relative(config.root, filePath)),
);

const fakeTemplate = `
const modules = import.meta.glob(${JSON.stringify(relativeFakeFilePath, null, 2)}, { eager: true });
Expand Down

0 comments on commit c699ea3

Please sign in to comment.