Import via Absolute Paths in Angular

The Solution

{
...
"compilerOptions": {
"baseUrl": "./",
...
},
...
}
{
...
"compilerOptions": {
"baseUrl": "./",
...
},
"paths": {
"@environments/*": ["./src/environments/*"]
},
...
}
{
...
"compilerOptions": {
"baseUrl": "./",
...
},
"paths": {
"@environments/*": ["./src/environments/*"],
"@shared/*": "["./src/app/shared/*"]
},
...
}

Conclusion

--

--

--

Full-stack software engineer specializing in web and mobile development. Always learning new things. “There is no growth in the comfort zone…”

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to deploy a react-app to different firebase hosting environments(dev and prod)

How to get the types you want with type guards

JavaScript Destructuring Explained

How to display a PDF file in React.js

Proxy in javascript

Life Cycle of React

Improving our email template development using Vue

Javascript interview question

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jacob Neterer

Jacob Neterer

Full-stack software engineer specializing in web and mobile development. Always learning new things. “There is no growth in the comfort zone…”

More from Medium

Angular Best Practices — 2022

Angular

How to avoid CORS error in Angular Development mode

Optimizing lodash size using Typescript compiler plugin

Lodash and Typescript logo pun

What is new in Angular 14?

A cover image that contains Angular logo and “What is new in Angular 14” text