storybook absolute paths code example

Example 1: storybook absolute paths

const path = require('path');
module.exports = {
  ...other settings....,

  webpackFinal: async (config) => {
    config.resolve.modules = [
      ...(config.resolve.modules || []),
      path.resolve(__dirname, "../src"),
    ];

    return config;
  },

}

// Then add this in your tsconfig.json/jsconfig.json
{
......
    "compilerOptions": {
        .....
        "baseUrl": "./src"
    }
}

Example 2: storybook absolute paths

{
...,
 "baseUrl": "./src/",
}

Example 3: storybook absolute paths

const path = require('path');

module.exports = {
  ...other settings....,

  webpackFinal: async (config) => {
    config.resolve.modules = [
      ...(config.resolve.modules || []),
      path.resolve(__dirname, "../src"),
    ];

    return config;
  },

}