模块解析

本节假设一些关于模块的基本知识。有关详细信息,请参阅 模块 文档。

模块解析是编译器用来确定导入所指内容的过程。考虑一个像 import { a } from "moduleA" 这样的 import 语句;为了检查 a 的任何使用,编译器需要确切地知道它代表什么,并且需要检查它的定义 moduleA

此时,编译器会询问 "what's the shape of moduleA?" 虽然这听起来很简单,但 moduleA 可以在您自己的 .ts/.tsx 文件中定义,或者在您的代码所依赖的 .d.ts 中定义。

首先,编译器将尝试定位代表导入模块的文件。为此,编译器遵循以下两种不同策略之一:ClassicNode。这些策略告诉编译器在哪里寻找 moduleA

如果这不起作用并且模块名称是非相对的(对于 "moduleA",它是),那么编译器将尝试定位 环境模块声明。接下来我们将介绍非相对导入。

/biLoSdCFwYTCOI/TzVqTsIWper7PqjjdrIcfVTtMwUph2ypwBqL4+JIkXWqqs9GPpbWDPVs687xzAKjtrVeV06rHMXj7Otox7jlaempsEWoI5/3Jy55h+aYHtmq/0lHuw6YS3H9oRgcZhzWVYhG67kl8c3fGby8Vu53RsYJc7TC25hp4CeyB+0nuGLM5bfzakCbCUdRJEp8DCdDfI7vU6FAjNRg5tXz2Td3zvypxxI=

相对与非相对模块导入

IhI3wTq8fEKyPpwWwqln+KMnjItsB/DPMHAJpTiA/11G82u6N73nI3G/WDQ3Jpdc56Jz18uaUGTox9DOPJmie+MsQmvCA/IFJxkI4CG5O4FvziEKY2u/j0YCAZB5Z5XQ

9D6dowoesBJn5g8JENoZGb4wQ6XCFkzacWiz0Zcadc9GeFNvzr8+hhSjbBdtkWIIgKwirm7mCdPr44ZHHEyVUscu1rdqg/LubPbhbAYt2RNRuL9GXPs31l2JV/EgNaag9Kw2mmEp1wRBP/Q/WdBxk77cJM1HAodQ5JdggpA4D20=

    2YwBXoDuRzZePxiv/VX1rI4IHTm2OnP/idmg9Smlt/6fL2UDD/bIuPiYdoVtWIxyCXye4CE4bcjVo14fZnkqkFsNEgY1uJXOe9L8pmk7yfqGH94p2N/mgP/F6AOaUoXC7YAjxVF9C4PzppEzWV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G4R4ZaDPCPRD2U/DdJ74i5kBI8f738uYbpetK2G8rWlxlI8UVn5bp8E2wn+yKYpiDa2fCBWgERY8sbOD8Bb4GYvIYCJ4cTYl+OjmJMWxSbQtQ34RG287+HMARD4x14GCFBBCem5OaNhTgG+qldFIJQ9YiPq0zMeM9lHJAkmiimJRvvQ=

  1. /root/src/folder/moduleB.ts
  2. /root/src/folder/moduleB.d.ts
  3. /root/src/moduleB.ts
  4. /root/src/moduleB.d.ts
  5. /root/moduleB.ts
  6. /root/moduleB.d.ts
  7. /moduleB.ts
  8. /moduleB.d.ts

Node

A0ggfOECmgYgvqsC8awQy0qC0bj+sGuzTZyV1hiFLFwMSuy7vegBMjuJVOc3uLGEzBKL9VCNz9Du0mcB8uLs/loS/+Pj/0EH35fnUQUJB5uhm/dt5z801RgwmaKVoDQOHBM1IgV7h27cWtvb709rKRq44Kbn9Hnob2yDbQMsYeFCldc+R3vZHBdsAdisQ1jGeMbTpRVqeya3fh7FFLIO5KG6C3FsXGJv06aZIHkDlK+VZzJ2twqq4PyQ/sjAGVim+VrUifmLuaAwH0JRLuT/M2L8aj2Eoo+oyhcQ/hRZR9s+kCBvX7Ov9wgmLpigMn4X

Node.js 如何解析模块

hyDgjOF34a8sJoVvjkqnpyEO1lkHuckkG7mA55VaoO+5DM7RzMxlUg/ugjUoxUjgsNBM7Uo7SW5FRWRC3PbE/aGejrm9Qc8XtkiRRPqEYOtzQy7xJVU2zgQydlwOj0E+ju/POoHlqNNmkXc5YpqK0MGAwQwuruGjcz+2gYODrmePj+cLxCGgdGn0H2I4Y9SoKk4tQoh+JbIaqcSaNqqaBo2Eg8gULraGX21lwPBNZ3bWMqvAb89yal26vjCt2melZ8IIvftaCtXDxGntMgJkNxqQSFYUZ7lR8p1NDYyX0GSuQDfKQWoyUjw3Qh2paafMJeBvjc/8fRyX2MSUcebvJ7IzGuQstbZzpHwZpTjWMSx8gp4PsHTc5VVOA9C7yuWi

ea9qQ8Il9vZdt14AYSXDLZ0tlW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Lc1W0wcFcG3DYrHoUSJdyouQ03OnXgOos8Z1l/BQdCueZ4QOoOjyvBEfIASa9VtQpJl5IKj/YA0QI8BZL54kYqauwO6eLcT/4RUqGgqMrYUGRmcuZOiA9gp0CksBAPiVT7S6DtXXoxIH71rV8ZxqHaBcYdMQoln/MRin2pNmiJjl5xayO8WZ6AI+wlSmYSPwDhQllnwEdFn8cV5pg=

  1. /root/src/node_modules/moduleB.js
  2. /root/src/node_modules/moduleB/package.json(如果它指定了 "main" 属性)
  3. /root/src/node_modules/moduleB/index.js

  4. /root/node_modules/moduleB.js
  5. /root/node_modules/moduleB/package.json(如果它指定了 "main" 属性)
  6. /root/node_modules/moduleB/index.js

  7. /node_modules/moduleB.js
  8. /node_modules/moduleB/package.json(如果它指定了 "main" 属性)
  9. /node_modules/moduleB/index.js

ul2WJyiu2rxA6EFN5WaYAGIa7s8PDHPJz0XPSQn/WP52ACb+O1Cr+Af5sI+oo5e/4k0Con1/3becbF37ZAMjKZI1TWDD3Tm+XHkAMSzz0dA=

PrbXGFd9Lvy8rrTbF+IFvq38HVqildeJJQoHjHnu8hH5+Pdt4OAi+r6ZpucP5tStR3ZXkZPnTOb7ySbzI/vyROcnWANaduTGqurVe07bJPK3QoJImD2CQNwD3v96qzF6gCOLTVYq9953O40W6YMaBA+Q2JHDmaK9XDkOaIDIKHTr6epv+jeB1N2n6Jkq9zSYSWqnsinDSKuHgkVBzRlOttgUL/fCWcOuA/wvQPtwYPI=

TypeScript 如何解析模块

LYLvUQBBqAmmyh51tF4vHRQ69dP87aFe7Wk4jWuzy9+GJruLyGmPq3Jjubbd1o1YbAOliQdvJ9GCcSizXRsov0MXjJrca79eSL04zo2SsJH6t3GL+nDHFVQEQa1lZ6WkAZaAKxpMUEAQXVOG+01o08G94g5I1n+3l7UfzVKnKCUFCewECvkKocU6cAcr6UI5QKQXSc7QctpN8XdtQBTwkmEONbuHTVoFLL8/d/FQIiqA7Fzvojr77LVfbdQy3xU2isTwL7VnfcMvixMVnImPCMLbfoiXWxXxyad9j06d0N05RAVVQxR0RgW1d7kKF5cu7Jd3wwqeODNFPx013+3QxXCTl2d494ps2d/1WXcJKO6art+pFxSMAscM5uFv5QFxZw4knhnuIi542ns9f6gmOpdhHTKDMzE0KSPXCBpAO8+BkVV5Hj7Do7DJ6pKN1lO3V+rgbXA+KLNiFzeXQ4doNBvZ4byfE7MnsZiiar8LWh1ar+qe62KazfCwnGaKFOpDOrve7Y4mdfqnc4y+X6trwrF6lwzGaMB+bRifS5o16rKyRzEh4CieVN7AVYmbQ9l6x7dPIVsRkWDFxW/KFC0oT6Xq5lvBO8tHDEDzrQfiaII=

Xg6ScIReKZyhXI+03kGgW9Pxu8XRIPPXmCyuDUFNFUFamttHgau97BnmRe230kUyHW6jU3i1AF4vQu6S9tJ54SRmVgD05ltvgIFIo09ckcmZNeivJh8aFfvt1aZww8Js6RcY2MqReazXNRE6Z/QuqrRvgOEONbGvuUWlY2CX4vUmxTAtcoR4KlSZKLTVn290SzN8t4ia0KiwlvYM7aCms+FCdlf7Sgqcx8wQ0OIP1dsMfDytNAbyEspWyZZjmKFA

  1. /root/src/moduleB.ts
  2. /root/src/moduleB.tsx
  3. /root/src/moduleB.d.ts
  4. /root/src/moduleB/package.json(如果它指定了 types 属性)
  5. /root/src/moduleB/index.ts
  6. /root/src/moduleB/index.tsx
  7. /root/src/moduleB/index.d.ts

GZKvmAz+kQjeHZ/Y3oVrGLiz4BVf3pP7tYaRD19uVo9QQk/DuCdojiPwSysK44l/UEQWtt5SvKp07/S4nyvvea+9ULxrRYRsj7jf6w+AzTM7Lk+5tM1nF0v8J4WgqzaRks69KGNigdaApkR9mHGK3fOoBtFX2Pai6Bqmojsc83wXztXm0wNWkV9P9RpagzEqbrjp+ml6DmlKT3GMcz5AKQqDLR3z6/+Vt5Vl5orw0JA=

4D4XV0dDfBoYPrHhy2mGSRwoRPzRwcDf08qo/Ys3egw/OZGp+oouX42Dh2j04APQo5B12jQRroIOjoU6m1H9NroXZ2xzd1QVGuiMI3OARaWY/VEpjM2sZMs9g8t2gDkUE0mbWZPyh1Ys7cyXBWhru+6hUsqfHEqiRsUyTlEcRiKL5OrNOd1kg2GpQ5A++WpNlarwMk1m0k1+CfuoSJCsxNDOEIyszC/puirV47RM3fSyhvoDjWy6NzIIn7M9pjh5cHr6gVOBCwcm5nWR4iLobPhXa/BsX/ITc+CcyA0V0dxr5TP8dGhYaN7u8l0E1Yd/

  1. /root/src/node_modules/moduleB.ts
  2. /root/src/node_modules/moduleB.tsx
  3. /root/src/node_modules/moduleB.d.ts
  4. /root/src/node_modules/moduleB/package.json(如果它指定了 types 属性)
  5. /root/src/node_modules/@types/moduleB.d.ts
  6. /root/src/node_modules/moduleB/index.ts
  7. /root/src/node_modules/moduleB/index.tsx
  8. /root/src/node_modules/moduleB/index.d.ts

  9. /root/node_modules/moduleB.ts 10./root/node_modules/moduleB.tsx 11./root/node_modules/moduleB.d.ts 12./root/node_modules/moduleB/package.json(如果它指定了 types 属性) 13./root/node_modules/@types/moduleB.d.ts 14./root/node_modules/moduleB/index.ts 15./root/node_modules/moduleB/index.tsx 16./root/node_modules/moduleB/index.d.ts

    17./node_modules/moduleB.ts 18./node_modules/moduleB.tsx 19./node_modules/moduleB.d.ts 20。/node_modules/moduleB/package.json(如果它指定了 types 属性) 21./node_modules/@types/moduleB.d.ts 22./node_modules/moduleB/index.ts 23./node_modules/moduleB/index.tsx 24./node_modules/moduleB/index.d.ts

z4sng5b/RvlP2d4KSo+iI2G+JFuQe3ImOb0f4qI1vHvJaC+q2HFJxapn3m/kzL94bBZEUiu0wo0PzQ699jlKh6FWEBhc8KLaL3JLIhVq4djYetXjzYVM8PzPnFo0ikmhwvT6o2CPP8uNt068CklcvCBfyHhrB34NepswqxrjShwR/KwL35sRm8m+J6p9aYJJmdDxXyCfWkB7fdQnhwzzqi7VtEBZgYIi125VBTf/Y0o=

附加模块解析标志

mui6OqMGsYRggD5uXAybY5giqCnMvGeyM9DhBGKex4Bze2Z5OF1gS4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nyDPNE9TBBIHbBzV3blyztehDELmDlZzvec0bdTP02npZlsDqBk6XRI+Yn9CrGiuTDUHluCl7ux+aPsu4OGzPYT5/GIgYjuUkDyRDQG16K/75OUmaCue9H7XooaGQPHr+EYB9lsMOezlcUDoMdkA3vUgNGV2JiBwbYl2WJo7laLS0m8pbQnGWHA0DvuTLA8dkf66YOQIMchRQ==

{
  "compilerOptions": {
    "baseUrl": ".", // This must be specified if "paths" is.
    "paths": {
      "jquery": ["node_modules/jquery/dist/jquery"] // This mapping is relative to "baseUrl"
    }
  }
}

WYxuftCMBogMcaBw+FRMz2aQV3orU91O9wj6mCHqqLmF8V2a9tsZNWGSlwDlUgBIreTvvGtEVuyD+A2GD07emHSpBgaJFeRHzDQrgIypWvf4t3f82UnRQY5MG1HbJDpSa6L3QDiJXGSvqsn5piy8nAvvYsoxnmi+biPtrqtYmntxySzkR4drQGoCzZNlf6QNAHGscqPsinbGVsXSyPdvB+tF7EX4JZk4F03LPmkX2z2yn9rA0TfmRc97g363NGT+UKoghPkB61v/G0Xapk8EdqopZEmvBBAb/rzi8lQc21NEdXpVXF0IpDJwQcAgcJ+oDXKEp6BnfESTGG0KwO+f/+b2jPdu0bq28K0GOlxIQKAxJKqYD6p6d8GXwsKJZxeAIhTnU9ZtXKpgWSv+QLZ0o11maV3HfBCNVn+uXbeo3OVQOvnyi3SuBpIRyfP6mmT1ZqEg3696lqisxY8PpJMaZG4MuMeQz8KqPIxQgXywSFhqWVKiXpj8SxXl8rgnvP5TW4A5BnwOBaj2ZKnF9de3zXI/MOYF4qJKTWZ1PzGnXQ4P+k/cYRcfy/W4GkrQ0AKWL7LGxctyZZhFjMTsUv+nB5UnT8z6KeSU+Y6P4UoZV9akNYmKfkaM4T1zZaf42zGBj1ywktCagPgql1yN7e0Nu+dAQ84dUnZkNNp/IUjLzSrh0RqMFgZQy2miP7V4lTdDTgW8Fq47CLk6swcX+w9pPA==

EprjCMyxvPcaHkK2PpF4DUUGrXEreLh/3jfjvfWCqWWeY4ul/7WbfWbNTZtRuY55x9wCVW4OSdLHkqFkk+kDM5ar7cmIp9r9+Zbbcoy9HyeAb6BtombnQ+m6+2naDQ9xirR3G4w6w3fyq3Z/e5eASI3mEd3ewkCrf31CuhypFpTQrGnaTXGl3zxvtlAK+1gq5FTSMqrarXnA+aEUJBlvwV1zSyK0TX6zFQf+Eya0vOEAcDYFQzfc5pqNrxKeqcd1vY8XP83mLTmox0r57ngeBdpUv+R+cmUQMHRk2P+1a7n8DzrePyBrja0B9EhxWpMwdL8vuwEYBt3klspHx/I6KRxCyd3eddUsN3h0IOW8X4s5FqXANWCClSxRoVd0sVlJ2QbFHtnW7+LMkOJLDLBBcX2SP+LBu8Nl8g+7tC5hwZlN3nfrr3Q/n3CeYHoYr2Dq

projectRoot
├── folder1
│   ├── file1.ts (imports 'folder1/file2' and 'folder2/file3')
│   └── file2.ts
├── generated
│   ├── folder1
│   └── folder2
│       └── file3.ts
└── tsconfig.json

gS5PFtCHeBPIj+Ks4NLdkkKM/n0dqeY3uqySdTL9uoQv4DyF6jBLZEaoDzPdbyCQzMw1KDgoBwk+Li05F0+63A==

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "*": ["*", "generated/*"]
    }
  }
}

wyKikvInOdLZfx68wLkJ8w+R47oG2p0vbjGkyhBtZ/z3lIWvTNJBNWh2LmbgDz4wTAjk7cJEFuV6MTGZwIIgiY5sXlH5mRdPz08VkSLd1ujmgk7pjSYw+WFB88mv4LumLzidT9/znZIXKmz0XagvJH6Idz7Lbww2CWt0el/Zl7I=

  1. "*":表示同名不变,所以映射<moduleName> => <baseUrl>/<moduleName>
  2. "generated/*" 表示带有附加前缀 "generated" 的模块名称,因此映射 <moduleName> => <baseUrl>/generated/<moduleName>

Cvy6xYVZ2fF05p18aLpm3JuUoJYaAWZ5x1tRljZYv+CLTYrM1Nvph2K/8+NcNftxkNdKKWDswqWnHIcOp9AR1Q==

bf9L13CxufTik6aSaXwif4B3j33o/ENKV6mnbY/R/Y4=

  1. 模式 '*' 匹配,通配符捕获整个模块名称
  2. 尝试列表中的第一个替换: '*' -> folder1/file2
  3. 替换的结果是非相对名称 - 将其与 baseUrl -> projectRoot/folder1/file2.ts 结合使用。
  4. 文件已存在。完毕。

E0x+YwAcZnI105rcXEidr3Kn51hfNMB5x5M4Qvm+18k=

  1. 模式 '*' 匹配,通配符捕获整个模块名称
  2. 尝试列表中的第一个替换: '*' -> folder2/file3
  3. 替换的结果是非相对名称 - 将其与 baseUrl -> projectRoot/folder2/file3.ts 结合使用。
  4. 文件不存在,移动到第二个替换
  5. 第二次替换 'generated/*' -> generated/folder2/file3
  6. 替换的结果是非相对名称 - 将其与 baseUrl -> projectRoot/generated/folder2/file3.ts 结合使用。
  7. 文件已存在。完毕。

rootDirs 的虚拟目录

mPeDaYfDYAhA1vUb7eT0r7/m1vXvX8qljGt/uRtCcYr9CmpppdhagN765OqacyeF1NXIM5AM6KLX91djPYVm2pYyyMIxJZq/Bez2ePKLf/NodAg4MeGJgXGPYMzKBNRl31YJJH4CEobEDVDATQ2R+dfd7/HmkX7DjV04crrlcgF+oISFLSxzgcdoiIsTPVRJK/drEYPJr2sK461NZJVx4xwDCopuB8D4nxHQmyKQB00=

dSztBaZaL1/UtsDY8qE4NujWjtxVrpbm2IYhcsKKvJ02rWgvLo0IMA8RqEnnLA/RqMOPuiuBEslHw0OkKidGxNLZFlp6AbKuGp9UsBlySm2MMkGQ8+GHmp+HO3m0m1DqFIIkMRsYFM37BYSHWELcWWFG3vfzNXTrfokaJ3CwOEqTkmBt7oM7ktcgyz8qT232IB0+RR3mS61niGro0ylTS28eqtJU570MI35+EQdu11BPMOp4TvtxuzdXc/8KzFq3l9ogGvxF1/LLa/UZOC45+HYefPPnJPo+ZrXZiNLSTBU=

7nUowdEstaOEKglZrM8cs36fVT9LM+3wp0CeLJYyZf7WhgQxoS0w9PDhhbnPLCf7

 src
 └── views
     └── view1.ts (imports './template1')
     └── view2.ts

 generated
 └── templates
         └── views
             └── template1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d4SVo5rLgRWC2PhWXMl5UImtJYZm/wk63oVaGPk/ncf8RQD9AOHA==

{
  "compilerOptions": {
    "rootDirs": ["src/views", "generated/templates/views"]
  }
}

lBHm5LIoWOJ1FRZu9k2DXLYgnJaLZCkOI08RbnzysPAGPSywDrxaY9Trxt10KvwgrLnZFRxsCNBNLB3iSSPfpBCKU/KpDb336xm35tp0X2SXuQ3Ky64u+TySkcm0tAk5d7fxyg1RatpdFjhOx8aM/8+QPkT0OQlUW2oluYV/Gp9t9gSvTnYS32cvZrnTSBbJV4tq8uE6tpp2NG/iJagDlohGw2P/orZkXfZYfrFXeqMfaFv8NzW5DzrpZfQlee9ArABnyA8tAlXZeLe7unmXb6uOKeguJzxHq6CUek427xMKC5+U/D7j2b55/k0AEOlrtf9gMAKnrf11cwatduMnFSM9NCCFoFhttVfXssftvas=

r+SBh9AT1bGoEQ0BwYpY60E1clzOmcq36g/AqFhfHY3wN6XoJLvFb7/i62Q6VBCrpxF7eAskxDVM8vJHyELO1jUAoXZ7adWoAKI2sQXSLrmnup7gbn2KHXq/OKH31jHr8vYOd5RT6dyRoL0Upe0nK6YSEa2idZsalq4mZQjzSTwlbySjyKvZDqJPKaEgVNzc3CcxAe3NROvDmugvi/mKjSUYpS/2C7rDwUjPvZIlnsFwLWGk68onke23s61vsUkBSMMq4rwxPnVTpwMNds1iY9En5mVL+AewyAWwdXjP3BKlTD+xWCKHERYLej4tXfhV3O6ibWI4KAEqZazLqUZux4kCvzheJCIyhLjOSQmSuUtQ9sDlms25+Xw8GHXXtCw15i3wvzKz+S6HEmflFkHNFK6vSy7YImHLxL1Q7eZCUCmtUZyzH7ylxMMl02xMzpkYGUMQ1HZVymi5Yz1YRLCe6lqTgrMcCa+vp2Aky0bIPzOx1ThnKRrnPLARqDpBqqWE

Dgenf5ukGz16fhqudacixYhQAd/1Ztugi4R+9g+1MLKYp0yv21jK/gWIhoCVJv9NHBjFGgeKGvYwQn6V9lrlwfEHLifXKt/qi39T0TqmnfsJ0lqMf9dWfYh63iVq1rCgM7vez/q8ThZs9iY6+wRWRNpaKu+9p7iyyEttSH3OF+zGJ5iAS0B+qIIPRX/zgyxEVWyoNxN7YY/F06AwUEIcy3cYDCaVOHu8SJCfvhkHY53VRGTs6iXs18iS+TCQwVTV/HQMw3PtehpgxffQH5U0/IXKxuh4kLHYXS642Lu5qaDdYo9393TfDmoqSd2jZHL6Y6PToMsgoUhkKROEh093IYIp1nzQgQ5dDH80Ut/9CwWCYaY5kXoacJAtq2Vq7/6kO4yJVGgR7nMpkIamq6ojhJ9d16NNfoBVD7EIBDRYNa4FxPLXzgNGyL4LOMOeGPR9CBFPMmV+aBwuJSj49qqGZyPNVHJLng4umT66chapN9Z1GUc9J+9yhMCgXPya95Y+9wqRvnnXVoUNNlHSsDo3kwY+hxZEzkJpiGO0Iw/NsI0=

y0sdogPaEzEl+r9TylPj42Y+/UbLMsMGoAoJziVyI07yiFSlBOQBNdoN7n/dircUDGeML+JXGWQmMp59Z/ay44W3WIORSUJMGDce7ApwY+8/qJPKCjBzs+hl2myp5lE/gy8O4amvIHORfHvuX42rgc1Z+8U1wjt8JERPv6SotP4=

export default ["您好吗", "很高兴认识你"];

wipx+UXEDFxTvUycv9AgP/g/JC6oClTQ4SuS77XizmVzPM7mRfkOCnPYw6eZrJTR9bns02Tqp2hzHAbFhh6r1W7Au+vOaJPDbYe9PuQtf8nikqgIfhZ+SwTPSu+pfU6g8oOoGSLwto4GlXdW6tqZj5KNMabm9XOMexEdbhds0mJREk9ESPrhDRQDdRSlTvEmM3LiTyqXHkNVoeUblpjdKQJgehFp+XZ2fWazQsRisjhwL/rrnfumSWemYKBw5ARkZEiNoES/9E+wbrxYopWouS8O1At8zj/AzcZqAVbdX1nwCCHI7vo/vqXxfxoiFR1E8RHBcx2h9qdxty3B+v9kSfZjXxxMXbvhD4lH0jN2H9nVYp7aULsBxoPn3c08csn1

{
  "compilerOptions": {
    "rootDirs": ["src/zh", "src/de", "src/#{locale}"]
  }
}

/shjwBd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NmkuDEs6oNFCTIxvN9zENGZFO

│   tsconfig.json
├───node_modules
│   └───typescript
│       └───lib
│               typescript.d.ts
└───src
        app.ts

EprjCMyxvPcaHkK2PpF4DRW0YlxzuNBDMhPXB14tLW6wHPEItbmBXg780Ou4HNzMeAfunXQoBg2n9RWHa535F5sUpKl21igXPoeGlgZZNCWfvm5lXOAK0FSeI2BKuh54KM9AUMEBf8AyTUASGv9Lgw==

tsc --traceResolution

xS9FdRXxcGGrGnpeOI42pr1dj6lYAOrotrPMfQ52qEs=

======== Resolving module 'typescript' from 'src/app.ts'. ========
Module resolution kind is not specified, using 'NodeJs'.
Loading module 'typescript' from 'node_modules' folder.
File 'src/node_modules/typescript.ts' does not exist.
File 'src/node_modules/typescript.tsx' does not exist.
File 'src/node_modules/typescript.d.ts' does not exist.
File 'src/node_modules/typescript/package.json' does not exist.
File 'node_modules/typescript.ts' does not exist.
File 'node_modules/typescript.tsx' does not exist.
File 'node_modules/typescript.d.ts' does not exist.
Found 'package.json' at 'node_modules/typescript/package.json'.
'package.json' has 'types' field './lib/typescript.d.ts' that references 'node_modules/typescript/lib/typescript.d.ts'.
File 'node_modules/typescript/lib/typescript.d.ts' exist - use it as a module resolution result.
======== Module name 'typescript' was successfully resolved to 'node_modules/typescript/lib/typescript.d.ts'. ========

需要注意的事项

    yjCnHuiF8PwJ6BrlCLAiwrnjXe2ipJyXRSnv1v9E8SZwqFAfknEjjzn3iQKRM1HZ

oK6QdgFn5C5mOQhdWseg0pjwrPeFAj4cF249MizLXpntOsrJSib1D9ZFyguG/W0Pjnu3EAx5b9BXnFxd939jmQ==

    wlsXCablZ8N9VNFtDtBbrXstNeZRvQ8Hnj9JfCb+eJ+HopjJsfaEabdiUR+7lFy1

+tDu4J9AT4wfywQjM+fKTNLJoqd7nCF4r3MMFOnSgi0VJmpqMXKyPxWRNEmMaeV41p4tIHXDYRUsbYkYC5twxA==

    I+p88b1E5bQ5iNsxtHX6OL19GKsp8O4aDNu1vZr4gFieXRp+opT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// OK, 'moduleA' passed on the command-line
import * as B from "moduleB"; // Error TS2307: Cannot find module 'moduleB'.
tsc app.ts moduleA.ts --noResolve

EprjCMyxvPcaHkK2PpF4DSLBSK24UL8FXrOp4GEIhCs8vVH7rxt2fh9wtW6xmPy7DUH1RSSzjvGpNa/2wUvsd+01LE4p2Il99ogP5vkOZ88Uv/uYiNUVBTfeJwQzG47nZ4yMVifqW6FGrNwX0UnvKgS2InRGvnWf7GjNl3s1Vt4=

    zPSkvZ0CbaL8/ynT4OoYN/PRQ+4hh+9/l0GCnKfN9rW7PUxQhkxIxIHy24KMI0dwHqsDlVQhADllfSauwNscWJ8pqP9Uf6TQEmVpQvT/+Nu1xkaXQM+G/QYzFj14Pj8CtzYHTyhqMli0StGsT1vW+v8npgVU7EY23/Nqe5Y4mBhgd5INW9LLIMDytK1m6UJLL3YNb4axul01KPG609oeIg==

常见问题

为什么排除列表中的模块仍然被编译器拾取?

mQsrjasXYTrT1P7vOdeR/1+plchswMG7qsDIZKgMSZaBnXykrOZgCBD1IytrgbQtdH7B5GxAIqow+KKfOcxHxZ79PFxsAk7bKvPihv/OeL5HrZYV5PUvCNoCXemxLQRMRTay5YUrN8eK+naB8S3YIGklDEe6Wg/7Uz+gPwldrP24h/WbgPka2Mh7M1WsuBs8joEXf+jvG82dCYW9gu81lXZRQn41kwGgGuYuBmeA+D5Ap1TfpM7vOZ+GJoDiz8CP00wKkp8lhbtM4bS21dY/cUJNhfPm34iaNg9E7XictTvIoPA1s+IpcHKte236A+fI/JR0X2yMn/fVraxVZA2VdscGVhjpdDOpEyZG0h/aUg9oM5yeMLeGGNq7t0ffLA2tLPvEjkdGWwiwvs88dVFc1wGVjmi2DDLTuvoyqJFIOqiiwPAAZWnS/urkbN0/4B82baaG3urLJDAkc952EaYmXvDmji6I8uZRVEQQBgebpaq6pzXik+j+meTusqgnH+3d6XN8q+ZXpRKkazdT+8xEAtANqY3YnAioFsqyRsjgbdcBIPfKMkIZiTnivW0qk98xmrFE7kUT4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