@putout/plugin-esm 8.2.0 → 8.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,13 +10,15 @@ const {
10
10
  readFileContent,
11
11
  } = operator;
12
12
 
13
- export const determineImportType = ({name, rootPath, importedFilename, privateImports}) => {
13
+ export const determineImportType = ({name, rootPath, importedFilename, privateImports, crawled}) => {
14
14
  const parsedName = parseImportedFilename({
15
15
  importedFilename,
16
16
  privateImports,
17
17
  });
18
18
 
19
- const [importedFile] = findFile(rootPath, parsedName);
19
+ const [importedFile] = findFile(rootPath, parsedName, {
20
+ crawled,
21
+ });
20
22
 
21
23
  if (!importedFile)
22
24
  return '';
@@ -16,6 +16,7 @@ const {
16
16
  getFilename,
17
17
  readFileContent,
18
18
  writeFileContent,
19
+ crawlDirectory,
19
20
  } = operator;
20
21
 
21
22
  const getMessage = (a) => a.message;
@@ -56,6 +57,7 @@ export const scan = (rootPath, {push, trackFile}) => {
56
57
  ];
57
58
 
58
59
  const getPrivateImports = createGetPrivateImports();
60
+ const crawled = crawlDirectory(rootPath);
59
61
 
60
62
  for (const file of trackFile(rootPath, mask)) {
61
63
  const content = readFileContent(file);
@@ -76,6 +78,7 @@ export const scan = (rootPath, {push, trackFile}) => {
76
78
  rootPath,
77
79
  importedFilename,
78
80
  privateImports,
81
+ crawled,
79
82
  });
80
83
 
81
84
  if (!importType)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-esm",
3
- "version": "8.2.0",
3
+ "version": "8.3.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin improves ability to transform ESM code",