Skip to content

Commit 6f19a21

Browse files
authored
Merge pull request #41 from storybookjs/kasper/tsconfig-paths
Use tsconfig paths plugin
2 parents 36fabc6 + 5d54947 commit 6f19a21

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@
8888
"image-size": "^2.0.0",
8989
"magic-string": "^0.30.11",
9090
"module-alias": "^2.2.3",
91-
"ts-dedent": "^2.2.0"
91+
"ts-dedent": "^2.2.0",
92+
"vite-tsconfig-paths": "^5.1.4"
9293
},
9394
"publishConfig": {
9495
"access": "public"

pnpm-lock.yaml

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { resolve } from "node:path";
33
import { createRequire } from "node:module";
44
import type { NextConfigComplete } from "next/dist/server/config-shared.js";
55
import type { Plugin } from "vite";
6+
import tsconfigPaths from "vite-tsconfig-paths";
7+
68
import { vitePluginNextEnv } from "./plugins/next-env/plugin";
79
import { vitePluginNextFont } from "./plugins/next-font/plugin";
810
import { vitePluginNextSwc } from "./plugins/next-swc/plugin";
@@ -37,6 +39,7 @@ function VitePlugin({ dir = process.cwd() }: VitePluginOptions = {}): Plugin[] {
3739
const nextConfigResolver = Promise.withResolvers<NextConfigComplete>();
3840

3941
return [
42+
tsconfigPaths({ root: resolvedDir }),
4043
{
4144
name: "vite-plugin-storybook-nextjs",
4245
enforce: "pre" as const,

0 commit comments

Comments
 (0)