mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
PM-24355 (#15862)
This commit is contained in:
@@ -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 type { StorybookConfig } from "@storybook/web-components-webpack5";
|
||||||
import remarkGfm from "remark-gfm";
|
import remarkGfm from "remark-gfm";
|
||||||
import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin";
|
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 =>
|
const getAbsolutePath = (value: string): string =>
|
||||||
dirname(require.resolve(join(value, "package.json")));
|
dirname(require.resolve(join(value, "package.json")));
|
||||||
|
|
||||||
@@ -43,7 +50,7 @@ const config: StorybookConfig = {
|
|||||||
if (config.resolve) {
|
if (config.resolve) {
|
||||||
config.resolve.plugins = [
|
config.resolve.plugins = [
|
||||||
new TsconfigPathsPlugin({
|
new TsconfigPathsPlugin({
|
||||||
configFile: path.resolve(__dirname, "../../../../../tsconfig.json"),
|
configFile: resolve(currentDirectory, "../../../../../tsconfig.json"),
|
||||||
}),
|
}),
|
||||||
] as any;
|
] as any;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user