Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Node.js Subpath imports

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for nikawa2161 nikawa2161
February 24, 2026
13

Node.js Subpath imports

Avatar for nikawa2161

nikawa2161

February 24, 2026

Transcript

  1. @/ // Before import { getCompanyById } from "../../../../../actions/companies/getCompanyById"; //

    After import { getCompanyById } from "@/actions/companies/getCompanyById";
  2. // Before: 深い相対パス import { getCompanyById } from "../../../../../actions/companies/getCompanyById"; //

    After: # サブパスインポート import { getCompanyById } from "#actions/companies/getCompanyById/index.ts";
  3. # Using 'imports' subpath '#*' with target './src/...'. Module name

    '#actions/companies/getCompanyById/index.ts' was successfully resolved to '.../apps/core-api/src/...'