<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Project-Config on Commentary of Takao</title><link>https://takao.blog/en/tags/project-config/</link><description>Recent content in Project-Config on Commentary of Takao</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>Commentary of Takao</copyright><lastBuildDate>Sat, 13 Jun 2026 23:11:50 +0900</lastBuildDate><atom:link href="https://takao.blog/en/tags/project-config/index.xml" rel="self" type="application/rss+xml"/><item><title>TypeScript Path Aliases: Clean Imports at Scale</title><link>https://takao.blog/en/web/typescript-path-aliases/</link><pubDate>Sun, 22 Dec 2024 00:00:00 +0900</pubDate><guid>https://takao.blog/en/web/typescript-path-aliases/</guid><description>&lt;img src="https://takao.blog/img/thumnail.webp" alt="Featured image of post TypeScript Path Aliases: Clean Imports at Scale" /&gt;&lt;p&gt;TypeScript path aliases eliminate the pain of deep relative imports like &lt;code&gt;../../../utils/helpers&lt;/code&gt;, replacing them with clean, intention-revealing paths such as &lt;code&gt;@utils/helpers&lt;/code&gt;. This article covers configuration, bundler integration, testing, and migration strategies.&lt;/p&gt;
&lt;h2 id="configuring-baseurl-and-paths"&gt;Configuring baseUrl and paths
&lt;/h2&gt;&lt;p&gt;The foundation of path aliases is the &lt;code&gt;paths&lt;/code&gt; mapping in &lt;code&gt;tsconfig.json&lt;/code&gt;, combined with &lt;code&gt;baseUrl&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;{
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;#34;compilerOptions&amp;#34;: {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;#34;baseUrl&amp;#34;: &amp;#34;.&amp;#34;,
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;#34;paths&amp;#34;: {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;#34;@/*&amp;#34;: [&amp;#34;./src/*&amp;#34;],
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;#34;@components/*&amp;#34;: [&amp;#34;./src/components/*&amp;#34;],
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;#34;@utils/*&amp;#34;: [&amp;#34;./src/utils/*&amp;#34;]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;baseUrl&lt;/code&gt; sets the base directory for resolving non-relative module names. &lt;code&gt;paths&lt;/code&gt; maps alias prefixes to file system locations relative to &lt;code&gt;baseUrl&lt;/code&gt;. The wildcard &lt;code&gt;*&lt;/code&gt; matches any path segment after the prefix.&lt;/p&gt;</description></item></channel></rss>