Skip to content

Commit 8b67398

Browse files
authored
Merge pull request #850 from bcgov/chore/vite-config-dirname
Use import.meta.dirname instead of __dirname in Vite config
2 parents cc4ea81 + 9dc3aa1 commit 8b67398

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

packages/react-components/vite.config.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,15 @@ import react from "@vitejs/plugin-react";
44
import path from "path";
55

66
// https://vitejs.dev/config/
7-
import { fileURLToPath } from "node:url";
87
import { storybookTest } from "@storybook/addon-vitest/vitest-plugin";
98
import { playwright } from "@vitest/browser-playwright";
10-
const dirname =
11-
typeof __dirname !== "undefined"
12-
? __dirname
13-
: path.dirname(fileURLToPath(import.meta.url));
9+
const dirname = import.meta.dirname;
1410

1511
// More info at: https://storybook.js.org/docs/next/writing-tests/integrations/vitest-addon
1612
export default defineConfig({
1713
resolve: {
1814
alias: {
19-
"@": path.resolve(__dirname, "./src"),
15+
"@": path.resolve(dirname, "./src"),
2016
},
2117
},
2218
plugins: [react()],

0 commit comments

Comments
 (0)