const path = require('path'); const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); const { NormalModuleReplacementPlugin } = require('webpack'); module.exports = { stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], addons: ['@storybook/addon-links', '@storybook/addon-essentials'], webpackFinal: async (config, { configType }) => { config.resolve.plugins = [ new TsconfigPathsPlugin({ configFile: path.resolve(__dirname, '../tsconfig.json'), }), ]; config.resolve.alias['next/link'] = path.resolve( __dirname, 'mocks/next_link.tsx' ); return config; }, typescript: { checkOptions: { tsconfig: path.resolve(__dirname, '../tsconfig.stories.json'), }, }, };