Skip to main content

Absolute Imports in React


Forum|alt.badge.img+3

Hi all, I would like to use absolute imports in my app, I have the following file structure

./
  /.block
  /build
  /node_modules
  /src
    /components
      /NavBar
        index.js
    /UI
      /Input
        index.js
    App.js
    index.js
  block.json
  package.json
  jsconfig.json

To avoid a bunch of …/…/ in my imports I am trying to use absolute imports.

I have

{
  "compilerOptions": {
    "baseUrl": "src"
  },
  "include": ["src"]
}

In my jsconfig.json however my absolute imports are not being found when I run the app in Airtable. Anyone have any thoughts?

0 replies

Be the first to reply!

Reply