storybook/docs/snippets/common/storybook-main-ts-module-resolution.js.mdx
Dave 8a79e815bc
Add require line for TsconfigPathsPlugin
you also need const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); in main.js. Obvious, perhaps, but it could save someone a step if they miss it (like I did :-) )
2021-11-23 16:45:21 -05:00

18 lines
354 B
Plaintext

```js
// .storybook/main.js
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
module.exports = {
webpackFinal: async (config) => {
config.resolve.plugins = [
...(config.resolve.plugins || []),
new TsconfigPathsPlugin({
extensions: config.resolve.extensions,
}),
];
return config;
},
};
```