From 5e5a24922bc3e1202d6202d9446e14895ec759da Mon Sep 17 00:00:00 2001 From: Daniel Riera Date: Wed, 6 Aug 2025 09:49:50 -0400 Subject: [PATCH] PM-24355 (#15862) --- .../content/components/.lit-storybook/main.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/browser/src/autofill/content/components/.lit-storybook/main.ts b/apps/browser/src/autofill/content/components/.lit-storybook/main.ts index a316d8f5baa..53c06264672 100644 --- a/apps/browser/src/autofill/content/components/.lit-storybook/main.ts +++ b/apps/browser/src/autofill/content/components/.lit-storybook/main.ts @@ -1,9 +1,16 @@ -import path, { dirname, join } from "path"; +import { createRequire } from "module"; +import { dirname, join, resolve } from "path"; +import { fileURLToPath } from "url"; import type { StorybookConfig } from "@storybook/web-components-webpack5"; import remarkGfm from "remark-gfm"; import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin"; +const currentFile = fileURLToPath(import.meta.url); +const currentDirectory = dirname(currentFile); + +const require = createRequire(import.meta.url); + const getAbsolutePath = (value: string): string => dirname(require.resolve(join(value, "package.json"))); @@ -43,7 +50,7 @@ const config: StorybookConfig = { if (config.resolve) { config.resolve.plugins = [ new TsconfigPathsPlugin({ - configFile: path.resolve(__dirname, "../../../../../tsconfig.json"), + configFile: resolve(currentDirectory, "../../../../../tsconfig.json"), }), ] as any; }