[Vuejs]-Is there possible way to add base url for imports in react js?

4👍

If you use Webpack, you can add the below code snippet into your webpack.config.js

resolve: {
  alias: {
     components: path.resolve(__dirname, 'src/components/')
  }
}

0👍

  1. Add jsconfig.json file in your root directory
  2. Place the code below to the file:
{
  "compilerOptions": {
    "baseUrl": "src"
  },
  "include": ["src"]
}
  1. Restart your npm script

Leave a comment