Source: www.amitmerchant.com

Avoid relative import paths in TypeScript
If you have been working with https://www.typescriptlang.org/ lately, you might have used relative paths to import modules or files. So, for instance, let’s say if I want to import a module that is two directories up from the current file location, I would need to import it like so.

To fix this, all you need is to set a compilerOptions.baseUrl config in your project’s tsconfig.json file.

Now, you won’t need to write those pesky relative import paths anymore.

import Order from 'components/order'; This will get resolved to./src/components/order.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners