@putout/plugin-esm 7.5.0 → 7.6.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.
@@ -4,11 +4,12 @@ export const fix = () => {};
4
4
 
5
5
  export const include = () => [
6
6
  'ImportDeclaration',
7
- 'ImportExpression',
7
+ 'import("__a")',
8
8
  ];
9
9
 
10
10
  export const filter = (path) => {
11
- const {value} = path.node.source;
11
+ const {source} = path.node;
12
+ const {value} = source;
12
13
 
13
14
  if (!value.startsWith('.'))
14
15
  return false;
@@ -93,6 +93,11 @@ function buildResolved(rootPath, importsTuples) {
93
93
  const withJs = `${current}.js`;
94
94
 
95
95
  if (findFile(rootPath, withIndex).length) {
96
+ if (relative.endsWith('/')) {
97
+ result.push([relative, `${relative}index.js`]);
98
+ continue;
99
+ }
100
+
96
101
  result.push([relative, `${relative}/index.js`]);
97
102
  continue;
98
103
  }
@@ -4,7 +4,7 @@ export const fix = () => {};
4
4
 
5
5
  export const include = () => [
6
6
  'ImportDeclaration',
7
- 'ImportExpression',
7
+ 'import("__a")',
8
8
  ];
9
9
 
10
10
  export const filter = (path) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-esm",
3
- "version": "7.5.0",
3
+ "version": "7.6.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",