@putout/plugin-esm 7.4.3 → 7.5.1

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.
@@ -7,5 +7,6 @@ export const replace = ({options}) => {
7
7
 
8
8
  return {
9
9
  [`import __imports from '${from}'`]: `import __imports from '${to}'`,
10
+ [`import('${from}')`]: `import('${to}')`,
10
11
  };
11
12
  };
@@ -4,13 +4,15 @@ export const fix = () => {};
4
4
 
5
5
  export const include = () => [
6
6
  'ImportDeclaration',
7
+ 'import("__a")',
7
8
  ];
8
9
 
9
10
  export const filter = (path) => {
10
- const {value} = path.node.source;
11
+ const {source} = path.node;
12
+ const {value} = source;
11
13
 
12
14
  if (!value.startsWith('.'))
13
15
  return false;
14
16
 
15
- return !/\.[m|c]?js/.test(value);
17
+ return !/\.[mc]?js/.test(value);
16
18
  };
@@ -59,6 +59,7 @@ export const scan = (rootPath, {push, trackFile}) => {
59
59
  const imports = places.map(getMessage);
60
60
  const filename = getFilename(file);
61
61
  const dir = dirname(filename);
62
+
62
63
  const importsTuples = buildImports(dir, imports);
63
64
  const resolvedTuples = buildResolved(rootPath, importsTuples);
64
65
 
@@ -4,6 +4,7 @@ export const fix = () => {};
4
4
 
5
5
  export const include = () => [
6
6
  'ImportDeclaration',
7
+ 'import("__a")',
7
8
  ];
8
9
 
9
10
  export const filter = (path) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-esm",
3
- "version": "7.4.3",
3
+ "version": "7.5.1",
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",