From 9462e64b3130cecda39076ab7e62179b01c3cfd0 Mon Sep 17 00:00:00 2001 From: Brijesh Bittu Date: Fri, 30 Aug 2024 12:38:55 +0530 Subject: [PATCH] Use variable names in vite and unplugin --- packages/pigment-css-unplugin/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/pigment-css-unplugin/src/index.ts b/packages/pigment-css-unplugin/src/index.ts index 6f276a05..6ae7addc 100644 --- a/packages/pigment-css-unplugin/src/index.ts +++ b/packages/pigment-css-unplugin/src/index.ts @@ -218,11 +218,11 @@ export const plugin = createUnplugin((options) => { compiler.options.resolve.plugins = compiler.options.resolve.plugins || []; compiler.options.resolve.plugins.push(resolverPlugin); }, - async transform(code, filePath) { - const [pathSegment] = filePath.split('?'); + async transform(code, url) { + const [filePath] = url.split('?'); // Converts path separator as per platform, even on Windows, path segments have `/` instead of the usual `\`, // so this function replaces such path separators. - const id = path.normalize(pathSegment); + const id = path.normalize(filePath); const transformServices = { options: { filename: id,