HarveyD / react-component-library

A project skeleton to get your very own React Component Library up and running using Rollup, Typescript, SASS + Storybook
https://blog.harveydelaney.com/creating-your-own-react-component-library/
MIT License
790 stars 167 forks source link

Include tsconfig-paths-webpack-plugin for relative paths #43

Open DarrenXu94 opened 3 years ago

DarrenXu94 commented 3 years ago

Add tsconfig-paths-webpack-plugin.

Updated .storybook/main.js folder to allow for paths defined in the tsconfig.json

config.resolve.plugins = [
      new TsconfigPathsPlugin({
        configFile: path.resolve(__dirname, "../tsconfig.json"),
      }),
    ];

tsconfig.json

"paths": {
      "~/*": ["./*"]
    },

This will allow you to import from "~/src"