LoginSignup
1
1

More than 3 years have passed since last update.

Storybookでtypescriptファイルを拡張子なしでインポートしたい

Posted at

jsからtsに移行中、プロダクトはちゃんとwebpack.config.jsが設定されてるので動いたけど、
Storybookが壊れて困ったのでメモとして残しておく。

.storybook/webpack.config.js
module.exports = async ({ config, mode }) => {
  ...
  config.resolve.extensions.push('.ts');

  return config;
};

こんな感じで設定すればOK。

Debug the default webpack config
にあるように、現状のconfigresolve.extensionsを確認した上で追加。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1