FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Stop Writing ../../../../../../ in Your Imports
NewsTools

Stop Writing ../../../../../../ in Your Imports

via Dev.to BeginnersAabhas Sao2w ago

Something clicked for me recently when I was staring at this line in my codebase: import Button from " ../../../../../../components/Button.tsx " Six levels deep. And honestly, what does that even tell you? You have to mentally trace backwards from wherever you currently are just to figure out where that file lives. The path is relative to this file, which means it looks different in every single file that imports the same component. There is a cleaner way. import Button from " @/components/Button.tsx " Same component. But now the path is absolute, it reads clearly, and it looks identical no matter which file you paste it into. You immediately know where to find it in the project. No counting ../ hops. Setting It Up It takes about five minutes. In your tsconfig.json : { "compilerOptions" : { "baseUrl" : "." , "paths" : { "@/*" : [ "src/*" ] } } } If you are using Vite: // vite.config.ts import { defineConfig } from " vite " import path from " path " export default defineConfig ({ resolv

Continue reading on Dev.to Beginners

Opens in a new tab

Read Full Article
24 views

Related Articles

Best WiiM Streamers (2026): Simplify Your Sound With WiiM Streaming Gear
News

Best WiiM Streamers (2026): Simplify Your Sound With WiiM Streaming Gear

Wired • 11h ago

Retrospec Judd Rev 2 Electric Folding Bike Review: Affordable, Simple, Easy to Store
News

Retrospec Judd Rev 2 Electric Folding Bike Review: Affordable, Simple, Easy to Store

Wired • 12h ago

These car gadgets are worth every penny
News

These car gadgets are worth every penny

ZDNet • 12h ago

Taylor Lorenz’s Screen Time Is Almost 17 Hours a Day
News

Taylor Lorenz’s Screen Time Is Almost 17 Hours a Day

Wired • 12h ago

These Are the 4 Artemis II Astronauts Leading the Historic Return to the Moon
News

These Are the 4 Artemis II Astronauts Leading the Historic Return to the Moon

Wired • 12h ago

Discover More Articles