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,