Skip to content

How to include path in compilierOptions in tsconfig #710

Closed Answered by segunadebayo
paulm17 asked this question in Q&A
Discussion options

You must be logged in to vote

This is mainly related to the tsconfig path not being detected correctly. Two things you can do:

  • Make sure the baseUrl is set in your project
  • If you're running into this in Storybook, then you might need some extra configuration like the one below
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin'

const config = {
  // ...
  webpackFinal: (config) => {
    config.resolve ??= {}
    config.resolve.plugins ??= []
    config.resolve.plugins.push(
      new TsconfigPathsPlugin({
        extensions: config.resolve.extensions,
      }),
    )

    return config
  },
}
export default config

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by segunadebayo
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants