iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🚀

Supporting tsconfig paths in Storybook

に公開

Conditions

  • Next.js 13
  • Storybook v6

Configuration

.storybook/main.js
const path = require('path')

module.exports = {
...
  // @see https://github.com/storybookjs/storybook/issues/3916#issuecomment-871283551
  webpackFinal(config) {
    config.resolve.alias = {
      ...config.resolve.alias,
      '@': path.resolve(__dirname, '../src'),
    }
    return config;
  },
};

References

https://github.com/storybookjs/storybook/issues/3916#issuecomment-871283551

Discussion