Skip to content
Merged
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
7 changes: 7 additions & 0 deletions change/@griffel-webpack-plugin-fix-windows-path.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: use fileURLToPath for Windows path compatibility",
"packageName": "@griffel/webpack-plugin",
"email": "hy.liu@berkeley.edu",
"dependentChangeType": "patch"
}
3 changes: 2 additions & 1 deletion packages/webpack-plugin/src/webpackLoader.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { EvalCache, transformSync, type TransformOptions, type TransformResult } from '@griffel/transform';
import type * as webpack from 'webpack';
import * as path from 'node:path';
import { fileURLToPath } from 'node:url';

import { GriffelCssLoaderContextKey, type SupplementedLoaderContext } from './constants.mjs';
import { generateCSSRules } from './utils/generateCSSRules.mjs';
Expand All @@ -10,7 +11,7 @@ export type WebpackLoaderOptions = Omit<TransformOptions, 'filename' | 'generate

type WebpackLoaderParams = Parameters<webpack.LoaderDefinitionFunction<WebpackLoaderOptions>>;

const __dirname = path.dirname(new URL(import.meta.url).pathname);
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// TODO: do something better, define via exports?
const virtualLoaderPath = path.resolve(__dirname, 'virtual-loader', 'index.cjs');
const virtualCSSFilePath = path.resolve(__dirname, 'virtual-loader', 'griffel.css');
Expand Down
Loading