# storybook에서 alias path 안되는 이슈

### 이슈&#x20;

상대경로 대신 @/\* 로 사용하기 위해 tsconfig.json 파일에 아래와 같이 셋팅을 하고 작업중입니다.&#x20;

```
"paths": {
      "@/components/*": ["components/*"],
      "@/pages/*": ["pages/*"],
      "@/styles/*": ["styles/*"],
      "@/utils/*": ["utils/*"]
    }            
```

그런데! storybook에서는 \`import xxx from '@/components/xxx';\` 와 같은 경로가 인식되지 않는 이슈발생&#x20;

### 해결방법&#x20;

npm install : [tsconfig-paths-webpack-plugin ](https://www.npmjs.com/package/tsconfig-paths-webpack-plugin)

> .storybook/main.js

```
const { TsconfigPathsPlugin } = require('tsconfig-paths-webpack-plugin');

module.exports = {
  stories: ['../components/**/*.stories.mdx', '../components/**/*.stories.@(js|jsx|ts|tsx)'],
  addons: [
    '@storybook/addon-links',
    '@storybook/addon-essentials',
    'storybook-addon-styled-component-theme/dist/preset',
  ],

  webpackFinal: async (config) => {
    [].push.apply(config.resolve.plugins, [
      new TsconfigPathsPlugin({ extensions: config.resolve.extensions })
    ]);

    return config;
  }
};
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sharryhong.gitbook.io/front-end/front-end-dev/storybook/storybook-alias-path.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
