diff --git a/.storybook/main.ts b/.storybook/main.ts index b2cc582..139088f 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -1,6 +1,6 @@ import type { StorybookConfig } from "@storybook/nextjs"; -import { dirname, join } from "path"; +import path, { dirname, join } from "path"; /** * This function is used to resolve the absolute path of a package. @@ -34,5 +34,15 @@ const config: StorybookConfig = { docs: { autodocs: "tag", }, + + webpackFinal: async config => { + if (config.resolve) { + config.resolve.alias = { + ...config.resolve.alias, + "@": path.resolve(__dirname, "../src"), + }; + } + return config; + }, }; export default config;