Skip to content

v0.7.6: @/ for the folder's own modules

1 min read

A patch release with a single change, and a breaking one: @/ replaces ~/ as the prefix for a source folder's own modules.

ts
import type { User } from "~/types/user";
import type { User } from "@/types/user";

It still resolves against the folder that imports it, so @/types/user in src/front is src/front/types/user.ts. Nothing else moves - the reserved prefixes are now:

PrefixResolves to
#/*project root
#src/*src/, any source folder by name
#lib/*var/lib/, any folder's derived code by name
@/*this source folder
_/*var/lib/<this folder>/

Details ›

Upgrading ​

Replace ~/ with @/ in your imports, and in customTypesImport if it uses it. No package name starts with ~/, so searching for "~/ and '~/ finds every one of them, and a plain replace is safe. The mapping itself lives in the generated tsconfig.json under var/lib/, which is written anew on the next start.

Coming from v0.7.4 or earlier, where @/ was still the project root, the order matters: first move the root imports from @/ to #/, as in v0.7.5, then ~/ to @/. The other way round, both kinds would end up under #/.

Released under the MIT License.