Rollup-plugin-typescript2: μ„ μ–Έ 파일 (d.ts)μ—μ„œ 경둜 별칭 확인

에 λ§Œλ“  2020λ…„ 01μ›” 01일  Β·  16μ½”λ©˜νŠΈ  Β·  좜처: ezolenko/rollup-plugin-typescript2

typescript ν”„λ‘œμ νŠΈμ— 경둜 별칭을 적용 ν•  λ•Œ κ²½λ‘œλŠ” λ‚΄ 보낸 μžλ°” 슀크립트 νŒŒμΌμ—μ„œ ν™•μΈλ˜μ§€λ§Œ μ„ μ–Έ νŒŒμΌμ—μ„œλŠ” ν™•μΈλ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

TypeScript νŒ€μ€ 경둜 확인이 μ»΄νŒŒμΌλŸ¬μ— ν¬ν•¨λ˜λŠ” 것이 μ•„λ‹ˆλ©° rollup / webpackκ³Ό 같은 μœ ν‹Έλ¦¬ν‹°μ˜ 도메인이라고 λͺ…μ‹œν–ˆμŠ΅λ‹ˆλ‹€.

버전

  • 타이프 슀크립트 : 3.7.4
  • λ‘€μ—… : 1.27.14
  • rollup-plugin-typescript2 : 0.25.3

λ‹€μŒ ν”„λ‘œμ νŠΈμ—μ„œλŠ” ~/* 별칭을 ./src/* . κΈ°λ³Έ λ””λ ‰ν† λ¦¬μ—μ„œ μ ˆλŒ€ 경둜λ₯Ό μ‚¬μš©ν•˜μ—¬ κ°€μ Έ 였기λ₯Ό ν—ˆμš©ν•©λ‹ˆλ‹€.

https://github.com/alshdavid-sandbox/rollup-typescript-library

npm install && make
cat dist/a/index.d.ts | grep "~"

cat λŠ” 아무것도 μΈμ‡„ν•˜μ§€ μ•Šμ§€λ§Œ ν˜„μž¬ μΈμ‡„λ©λ‹ˆλ‹€.

import { B } from '~/b';

이것은 μ„ μ–Έ νŒŒμΌμ— 경둜 확인을 μ μš©ν•˜μ§€ μ•ŠμŒμ„ λ³΄μ—¬μ€λ‹ˆλ‹€.

bug controversial enhancement help wanted

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

예, ttscλ₯Ό μ‚¬μš©ν•˜μ—¬ 이것을 λ‹¬μ„±ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. rollup-plugin-typescript2 transformers μ˜΅μ…˜μœΌλ‘œ 트랜슀포머λ₯Ό 직접 μž‘λ™μ‹œν‚¬ 수 μ—†μ—ˆκΈ° λ•Œλ¬Έμ— ttsc λ₯Ό μ‚¬μš©ν•˜κΈ°λ‘œν–ˆμŠ΅λ‹ˆλ‹€.

λ‚΄ λ‘€μ—… ꡬ성은 λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.

import typescript from 'rollup-plugin-typescript2'

export default {
  input: `src/index.ts`,
  preserveModules: true,
  output: {
    format: 'esm',
    dir: './dist'
  },
  external: [],
  watch: {
    include: 'src/**',
  },
  plugins: [
    typescript({ 
      typescript: require('ttypescript'),
      tsconfigDefaults: {
        compilerOptions: {
          plugins: [
            { "transform": "typescript-transform-paths" },
            { "transform": "typescript-transform-paths", "afterDeclarations": true }
          ]
        }
      }
    }),
  ],
}

λͺ¨λ“  16 λŒ“κΈ€

typescript μ‚¬λžŒλ“€μ— λ”°λ₯΄λ©΄, 당신은 그것을 거꾸둜 μ‚¬μš©ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

우리의 일반적인 κ²¬ν•΄λŠ” TS에 λŒ€ν•΄ μ¦‰μ‹œ μž‘λ™ν•˜λŠ” κ°€μ Έ 였기λ₯Ό μž‘μ„±ν•˜κ³  μ‹œλ„ν•˜λŠ” λŒ€μ‹  λŸ°νƒ€μž„μ— μž‘λ™ν•˜λŠ” κ°€μ Έ 였기 경둜λ₯Ό μž‘μ„±ν•˜κ³  컴파일러의 λͺ¨λ“ˆ 확인 단계λ₯Ό μΆ©μ‘±ν•˜λ„λ‘ TS ν”Œλž˜κ·Έλ₯Ό μ„€μ •ν•΄μ•Όν•œλ‹€λŠ” κ²ƒμž…λ‹ˆλ‹€. λŸ°νƒ€μž„μ— μž‘λ™ν•˜λŠ” 경둜λ₯Ό "μˆ˜μ •"ν•˜λŠ” λ‹€λ₯Έ 단계가 μžˆμŠ΅λ‹ˆλ‹€.

https://github.com/microsoft/TypeScript/issues/15479

ν˜„μž¬μ΄ ν”ŒλŸ¬κ·ΈμΈμ€ typescript에 μ˜ν•΄ 방좜되면 μœ ν˜• 선언을 μ²˜λ¦¬ν•˜κ±°λ‚˜ ꡬ문 λΆ„μ„ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

검색 / 바꾸기보닀 μ•½κ°„ 더 λ‚˜μ€ μž‘μ—…μ„ μˆ˜ν–‰ ν•  수 μžˆμ§€λ§Œ 일반적으둜이 문제λ₯Ό ν•΄κ²°ν•˜λ €λ©΄ 기본적으둜 μœ ν˜• 선언에 λŒ€ν•œ 둀업을 λ‹€μ‹œ κ΅¬ν˜„ν•΄μ•Όν•©λ‹ˆλ‹€ (λ‚΄κ°€ 보지 μ•ŠλŠ” λ™μ•ˆ λ²ˆλ“€ 선언을 μƒμ„±ν•˜κΈ° μœ„ν•΄ μ–Έμ–΄ μ„œλΉ„μŠ€ APIλ₯Ό 이미 μΆ”κ°€ν•˜μ§€ μ•Šμ€ 경우).

λ‹΅μž₯을 보내 μ£Όμ…”μ„œ κ°μ‚¬ν•©λ‹ˆλ‹€. μ‘°μž‘ν•œ 검색 / ꡐ체 ν›„ 처리 단계λ₯Ό μ—°κ²°ν•˜λŠ” 데 μ‚¬μš©ν•  μˆ˜μžˆλŠ” κ°μ‹œ λͺ¨λ“œμ™€ λΉŒλ“œ λͺ¨λ“œ λͺ¨λ‘μ—μ„œ μ‹€ν–‰λ˜λŠ” "포슀트 방좜"후크가 μžˆμŠ΅λ‹ˆκΉŒ?

d.ts νŒŒμΌμ€ λ‘€μ—… νŒŒμ΄ν”„ 라인으둜 직접 λ°©μΆœλ˜λ―€λ‘œ ( useTsconfigDeclarationDir: false μ˜΅μ…˜μ΄ μ‚¬μš©λ˜λŠ” 경우)이λ₯Ό λ³€ν™˜ν•˜λŠ” λ‘€μ—… ν”ŒλŸ¬κ·ΈμΈμ„ λ§Œλ“€ 수 μžˆμŠ΅λ‹ˆλ‹€.

λ²ˆλ“€μ΄ μž‘μ„± 될 λ•Œ λ°©μΆœλ˜λ―€λ‘œ transform λŒ€μ‹  generateBundle 후크λ₯Ό μ‚¬μš©ν•΄μ•Ό ν•  μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.

μž‘λ™ν•˜μ§€ μ•ŠμœΌλ©΄. rpt2 μžμ²΄μ— 사전 μ“°κΈ° 후크λ₯Ό μΆ”κ°€ ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

λ™μΌν•œ λ¬Έμ œκ°€ λ°œμƒν•˜μ—¬ μ—¬κΈ° μ—μ„œ ν•΄κ²° 방법을 μ°Ύμ•˜μŠ΅λ‹ˆλ‹€
ν˜„μž¬ ttsc λ₯Ό typescript-transform-paths ttsc 와 ν•¨κ»˜ μ‚¬μš©ν•˜μ—¬ λ‘€μ—… 된 ts νŒŒμΌμ„ λ‘€μ—… ν•œ ν›„ μ„ μ–Έ νŒŒμΌμ„ μƒμ„±ν•©λ‹ˆλ‹€. μΌμ’…μ˜ μ€‘λ³΅μ΄μ§€λ§Œ μž‘λ™ν•©λ‹ˆλ‹€ ...

예, ttscλ₯Ό μ‚¬μš©ν•˜μ—¬ 이것을 λ‹¬μ„±ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. rollup-plugin-typescript2 transformers μ˜΅μ…˜μœΌλ‘œ 트랜슀포머λ₯Ό 직접 μž‘λ™μ‹œν‚¬ 수 μ—†μ—ˆκΈ° λ•Œλ¬Έμ— ttsc λ₯Ό μ‚¬μš©ν•˜κΈ°λ‘œν–ˆμŠ΅λ‹ˆλ‹€.

λ‚΄ λ‘€μ—… ꡬ성은 λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.

import typescript from 'rollup-plugin-typescript2'

export default {
  input: `src/index.ts`,
  preserveModules: true,
  output: {
    format: 'esm',
    dir: './dist'
  },
  external: [],
  watch: {
    include: 'src/**',
  },
  plugins: [
    typescript({ 
      typescript: require('ttypescript'),
      tsconfigDefaults: {
        compilerOptions: {
          plugins: [
            { "transform": "typescript-transform-paths" },
            { "transform": "typescript-transform-paths", "afterDeclarations": true }
          ]
        }
      }
    }),
  ],
}

κ°μ‚¬ν•©λ‹ˆλ‹€ @alshdavid ! 당신은 λ‚΄ 생λͺ…을 κ΅¬ν–ˆμŠ΅λ‹ˆλ‹€! μ–΄μ œ λ‚˜λŠ” 같은 λ¬Έμ œκ°€ μžˆμ—ˆκ³  typescript-transform-paths λ₯Ό μ‚¬μš©ν•˜μ—¬ ν•΄κ²°ν–ˆμŠ΅λ‹ˆλ‹€! κ°μ‚¬ν•©λ‹ˆλ‹€ πŸ’ͺ

// webpack.config.js
module: {
    rules: [
      {
        test: /\.(ts|tsx)$/,
        use: [
          {
            loader: require.resolve('ts-loader'),
            options: {
              compiler: 'ttypescript',
            },
          },
          {
            loader: require.resolve('react-docgen-typescript-loader'),
          },
        ],
        exclude: /(node_modules)/,
      },
    ],
  },
// tsconfig.json
compilerOptions: {
  "plugins": [
     { "transform": "typescript-transform-paths" },
     { "transform": "typescript-transform-paths", "afterDeclarations": true }
   ]
}

이 μ†”λ£¨μ…˜μ€ 과거에 μ €μ—κ²Œ 효과적 μ΄μ—ˆμ§€λ§Œ μ§€κΈˆμ€ λ‹€μŒκ³Ό 같은 였λ₯˜κ°€ λ°œμƒν•˜λŠ” λ§Žμ€ 상황을 μ°Ύκ³  μžˆμŠ΅λ‹ˆλ‹€.

UnhandledPromiseRejectionWarning : TypeError : μ •μ˜λ˜μ§€ μ•Šμ€ 'text'속성을 읽을 수 μ—†μŠ΅λ‹ˆλ‹€.

별칭 (및 μ΄λŸ¬ν•œ ν”ŒλŸ¬κ·ΈμΈ) μ‚¬μš©μ—μ„œ λ²—μ–΄λ‚˜λ©΄ λ¬Έμ œμ—†μ΄ μž‘λ™ν•©λ‹ˆλ‹€. λ‹€λ₯Έ μ‚¬λžŒμ΄μ΄ λ¬Έμ œκ°€ μžˆμŠ΅λ‹ˆκΉŒ?

이 μ†”λ£¨μ…˜μ€ 과거에 μ €μ—κ²Œ 효과적 μ΄μ—ˆμ§€λ§Œ μ§€κΈˆμ€ λ‹€μŒκ³Ό 같은 였λ₯˜κ°€ λ°œμƒν•˜λŠ” λ§Žμ€ 상황을 μ°Ύκ³  μžˆμŠ΅λ‹ˆλ‹€.

UnhandledPromiseRejectionWarning : TypeError : μ •μ˜λ˜μ§€ μ•Šμ€ 'text'속성을 읽을 수 μ—†μŠ΅λ‹ˆλ‹€.

별칭 (및 μ΄λŸ¬ν•œ ν”ŒλŸ¬κ·ΈμΈ) μ‚¬μš©μ—μ„œ λ²—μ–΄λ‚˜λ©΄ λ¬Έμ œμ—†μ΄ μž‘λ™ν•©λ‹ˆλ‹€. λ‹€λ₯Έ μ‚¬λžŒμ΄μ΄ λ¬Έμ œκ°€ μžˆμŠ΅λ‹ˆκΉŒ?

같은 였λ₯˜κ°€ μžˆμŠ΅λ‹ˆλ‹€

이 μ†”λ£¨μ…˜μ€ 과거에 μ €μ—κ²Œ 효과적 μ΄μ—ˆμ§€λ§Œ μ§€κΈˆμ€ λ‹€μŒκ³Ό 같은 였λ₯˜κ°€ λ°œμƒν•˜λŠ” λ§Žμ€ 상황을 μ°Ύκ³  μžˆμŠ΅λ‹ˆλ‹€.

UnhandledPromiseRejectionWarning : TypeError : μ •μ˜λ˜μ§€ μ•Šμ€ 'text'속성을 읽을 수 μ—†μŠ΅λ‹ˆλ‹€.

별칭 (및 μ΄λŸ¬ν•œ ν”ŒλŸ¬κ·ΈμΈ) μ‚¬μš©μ—μ„œ λ²—μ–΄λ‚˜λ©΄ λ¬Έμ œμ—†μ΄ μž‘λ™ν•©λ‹ˆλ‹€. λ‹€λ₯Έ μ‚¬λžŒμ΄μ΄ λ¬Έμ œκ°€ μžˆμŠ΅λ‹ˆκΉŒ?

μ•ˆλ…•ν•˜μ„Έμš”, μ €λŠ” λ™μΌν•œ 문제λ₯Ό λ°œμƒμ‹œν‚€κ³  μžˆμ§€λ§Œ λ‹€λ₯Έ λ§₯λ½μ—μ„œ : Vue 및 Typescript둜 μž‘μ„±λœ ꡬ성 μš”μ†Œ 라이브러리λ₯Ό λ²ˆλ“€λ‘œ λ¬ΆκΈ° μœ„ν•΄ 둀업을 μ‚¬μš©ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. λ‹€μŒμ€ rollup.config.js νŒŒμΌμž…λ‹ˆλ‹€.

import path from "path";

import alias from "@rollup/plugin-alias";
import cleaner from "rollup-plugin-cleaner";
import css from "rollup-plugin-css-only";
import scss from "rollup-plugin-scss";
import typescript from "rollup-plugin-typescript2";
import vue from "rollup-plugin-vue";

export default [
  {
    input: "./src/index.ts",
    preserveModules: true,
    output: {
      format: "esm",
      dist: "./dist"
    },
    plugins: [
      cleaner({ targets: ["dist/"] }),
      alias({
        resolve: [".ts", ".vue"],
        entries: { "@/": path.resolve(__dirname, "./src/") }
      }),
      css({ output: "dist/bundle.css" }),
      scss(),
      typescript({
        typescript: require("ttypescript"),
        tsconfigDefaults: {
          compilerOptions: {
            plugins: [
              { transform: "typescript-transform-paths" },
              {
                transform: "typescript-transform-paths",
                afterDeclarations: true
              }
            ]
          }
        }
      }),
      vue({ css: false })
    ]
  }
];

별칭을 ν•΄κ²°ν•˜κΈ° μœ„ν•΄ rollup --config ttsc --emitDeclarationOnly λͺ…λ Ή λ‹€μŒμ— 이미 .vue.d.ts νŒŒμΌμ€ μ²˜λ¦¬λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€ (λ¬Όλ‘ ).

ttypescript 및 typescript-transofrm-paths κ³Ό 같은 λ¬Έμ œμ΄μ§€λ§Œ μž‘λ™ν•˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€. λΉŒλ“œλ₯Ό μ‹€ν–‰ν•  λ•Œ :

[!] (plugin rpt2) TypeError: Cannot read property 'text' of undefined

ν•˜μ§€λ§Œ @zerollup/ts-transform-paths 및 ttypescript ν•˜λ©΄ μž‘λ™ν•©λ‹ˆλ‹€ πŸŽ‰

여기에 멋진 섀정이 μžˆμŠ΅λ‹ˆλ‹€ : https://www.npmjs.com/package/@zerollup/ts -transform-paths # setup-for-rollup-plugin-typescript2

_rollup.config.js_

import ttypescript from 'ttypescript'
import tsPlugin from 'rollup-plugin-typescript2'

export default {
    input: 'src/lib.ts',
    output: [{ file : 'dist/lib.js', name : 'mylib', format : 'iife', sourcemap : true }],
    plugins: [
        tsPlugin({
            typescript: ttypescript
        })
    ]
}

_tsconfig.json_

{
    "compilerOptions": {
        "baseUrl": ".",
        "paths": {
            "my-lib/*": ["src/*"]
        },
        "plugins": [
            {
                "transform": "@zerollup/ts-transform-paths",
                "exclude": ["*"]
            }
        ]
    }
}

큰! λ‹€λ₯Έ λ°©λ²•μœΌλ‘œ ν•΄κ²°ν–ˆμ§€λ§Œμ΄ ν”ŒλŸ¬κ·ΈμΈκ³Ό 관련이 μ—†μŠ΅λ‹ˆλ‹€. typescript-transform-path 및 ttypescriptλ₯Ό μ œκ±°ν•˜κ³  ν˜„μž¬ ν”ŒλŸ¬κ·ΈμΈμ„ κ·ΈλŒ€λ‘œ λ‘μ—ˆμŠ΅λ‹ˆλ‹€ (typescript ()). λ‘€μ—… ν›„ tsc-aliasλ₯Ό μ‚¬μš©ν•˜μ—¬ 문제λ₯Ό ν•΄κ²°ν–ˆμŠ΅λ‹ˆλ‹€. 생성 ν›„ .d.ts νŒŒμΌμ„ μ²˜λ¦¬ν•˜κΈ° λ•Œλ¬Έμ— vue νŒŒμΌλ„ λŒ€μ²΄ν•©λ‹ˆλ‹€.

문제λ₯Ό ν•΄κ²°ν•˜κΈ° μœ„ν•΄ λ‘€μ—… ν›„ tsc-alias λ₯Ό μ‚¬μš©ν–ˆμŠ΅λ‹ˆλ‹€. 생성 ν›„ .d.ts νŒŒμΌμ„ μ²˜λ¦¬ν•˜κΈ° λ•Œλ¬Έμ— vue νŒŒμΌλ„ λŒ€μ²΄ν•©λ‹ˆλ‹€.

@mantlebee tsconfig.json 및 λ‘€μ—… κ΅¬μ„±μ˜ 예λ₯Ό κ²Œμ‹œ ν•΄ μ£Όμ‹œκ² μŠ΅λ‹ˆκΉŒ?

ν•˜μ§€λ§Œ @zerollup/ts-transform-paths 및 ttypescript ν•˜λ©΄ μž‘λ™ν•©λ‹ˆλ‹€ πŸŽ‰

@luanorlandi κ°€ λŸ°νƒ€μž„μ— ts-transform-path μž‘λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆκΉŒ? μ•„λ§ˆλ„ 라이브러리 μ½”λ“œμ— λŒ€ν•œ 쒋은 생각은 아닐 κ²ƒμž…λ‹ˆλ‹€.

문제λ₯Ό ν•΄κ²°ν•˜κΈ° μœ„ν•΄ λ‘€μ—… ν›„ tsc-alias λ₯Ό μ‚¬μš©ν–ˆμŠ΅λ‹ˆλ‹€. 생성 ν›„ .d.ts νŒŒμΌμ„ μ²˜λ¦¬ν•˜κΈ° λ•Œλ¬Έμ— vue νŒŒμΌλ„ λŒ€μ²΄ν•©λ‹ˆλ‹€.

@mantlebee tsconfig.json 및 λ‘€μ—… κ΅¬μ„±μ˜ 예λ₯Ό κ²Œμ‹œ ν•΄ μ£Όμ‹œκ² μŠ΅λ‹ˆκΉŒ?

μ€‘μš”ν•œ 속성은 declaration , declarationDir 및 outDir

// tsconfig.json
{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "strict": true,
    "jsx": "preserve",
    "importHelpers": true,
    "moduleResolution": "node",
    "experimentalDecorators": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "sourceMap": true,
    "declaration": true,
    "declarationDir": "dist/src",
    "baseUrl": ".",
    "outDir": "dist/src",
    "types": [
      "webpack-env",
      "jest"
    ],
    "paths": {
      "@/*": [
        "src/*"
      ]
    },
    "lib": [
      "esnext",
      "dom",
      "dom.iterable",
      "scripthost"
    ]
  },
  "include": [
    "src/**/*.ts",
    "src/**/*.tsx",
    "src/**/*.vue",
    "tests/**/*.ts",
    "tests/**/*.tsx"
  ],
  "exclude": [
    "node_modules"
  ]
}

κ°„λ‹¨ν•œ rollup.config.js 파일

import path from "path";

import alias from "@rollup/plugin-alias";
import cleaner from "rollup-plugin-cleaner";
import scss from "rollup-plugin-scss";
import typescript from "rollup-plugin-typescript2";
import vue from "rollup-plugin-vue";

export default [
  {
    input: "src/index.ts",
    output: {
      format: "esm",
      file: "dist/elegere-ui.js"
    },
    plugins: [
      cleaner({ targets: ["dist/"] }),
      alias({
        resolve: [".ts", ".vue"],
        entries: { "@/": path.resolve(__dirname, "src/") }
      }),
      scss(),
      typescript({
        useTsconfigDeclarationDir: true
      }),
      vue()
      //{ css: false }
    ]
  }
];

그런 λ‹€μŒ λͺ¨λ“  것을 prepublishOnly λͺ…령에 λ„£μŠ΅λ‹ˆλ‹€ (λ‚˜μ—κ²Œ μœ μš©ν•˜κΈ° λ•Œλ¬Έμ—)

"prepublishOnly": "npm run rollup && tsc-alias && npm run docs"

TSC-ALIASλŠ” dist/src 폴더 λ‚΄μ—μ„œ ꡐ체λ₯Ό μˆ˜ν–‰ν•©λ‹ˆλ‹€. ts-aliasκ°€ src 폴더 μ•ˆμ— μžˆλ‹€κ³  μƒκ°ν•˜λŠ” 별칭을 λŒ€μ²΄ν•˜κΈ° λ•Œλ¬Έμ— λͺ¨λ“  것을 κ·Έ μ•ˆμ— λ„£κΈ°λ‘œ μ„ νƒν•©λ‹ˆλ‹€.

졜적의 결둠은 μ•„λ‹ˆμ§€λ§Œ μž‘λ™ν•©λ‹ˆλ‹€. μ΅œλŒ€ν•œ 빨리 @luanorlandi 의 μ†”λ£¨μ…˜μ„ 확인

λ¬Όλ‘  jest 와 같은 dist/src 폴더λ₯Ό ν”Όν•˜λ„λ‘ λ‹€λ₯Έ λͺ¨λ“  libλ₯Ό κ΅¬μ„±ν•΄μ•Όν•©λ‹ˆλ‹€.

ν•˜μ§€λ§Œ @zerollup/ts-transform-paths 및 ttypescript ν•˜λ©΄ μž‘λ™ν•©λ‹ˆλ‹€ πŸŽ‰

@luanorlandi κ°€ λŸ°νƒ€μž„μ— ts-transform-path μž‘λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆκΉŒ? μ•„λ§ˆλ„ 라이브러리 μ½”λ“œμ— λŒ€ν•œ 쒋은 생각은 아닐 κ²ƒμž…λ‹ˆλ‹€.

λ‚˜λŠ” κ·Έλ ‡κ²Œ μƒκ°ν•˜μ§€ μ•ŠλŠ”λ‹€. λ³€ν™˜κΈ°λŠ” λΌμ΄λΈŒλŸ¬λ¦¬κ°€ μ„€λͺ… ν•˜λ“―μ΄ λΉŒλ“œ λ‹¨κ³„λ§Œμ„μœ„ν•œ 것이닀.

_... tsconfig baseUrl + λ²ˆλ“€ 및 μ„ μ–Έ νŒŒμΌμ—μ„œ 별칭 재 μž‘μ„± 경둜. κ·Έλ“€ λͺ¨λ‘λŠ” transpiled js와 d.ts νŒŒμΌμ—μ„œ relative둜 λ‹€μ‹œ μž‘μ„±λ©λ‹ˆλ‹€.

https://www.npmjs.com/package/@zerollup/ts -transform-paths

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰