unplugin-isolated-decl 0.13.8 → 0.13.9

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.
package/dist/esbuild.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./transformer-CiAWE027.js";
2
- import { IsolatedDecl } from "./src-CLaOCtRu.js";
2
+ import { IsolatedDecl } from "./src-B5I0aiDn.js";
3
3
 
4
4
  //#region src/esbuild.ts
5
5
  /**
package/dist/farm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./transformer-CiAWE027.js";
2
- import { IsolatedDecl } from "./src-CLaOCtRu.js";
2
+ import { IsolatedDecl } from "./src-B5I0aiDn.js";
3
3
 
4
4
  //#region src/farm.ts
5
5
  /**
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import "./transformer-CiAWE027.js";
2
- import { IsolatedDecl } from "./src-CLaOCtRu.js";
2
+ import { IsolatedDecl } from "./src-B5I0aiDn.js";
3
3
 
4
4
  export { IsolatedDecl };
package/dist/rolldown.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./transformer-CiAWE027.js";
2
- import { IsolatedDecl } from "./src-CLaOCtRu.js";
2
+ import { IsolatedDecl } from "./src-B5I0aiDn.js";
3
3
 
4
4
  //#region src/rolldown.ts
5
5
  /**
package/dist/rollup.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./transformer-CiAWE027.js";
2
- import { IsolatedDecl } from "./src-CLaOCtRu.js";
2
+ import { IsolatedDecl } from "./src-B5I0aiDn.js";
3
3
 
4
4
  //#region src/rollup.ts
5
5
  /**
@@ -50,7 +50,7 @@ function shouldAddIndex(id, resolved) {
50
50
  //#endregion
51
51
  //#region src/core/ast.ts
52
52
  function filterImports(program) {
53
- return program.body.filter((node) => (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ExportNamedDeclaration") && !!node.source);
53
+ return program.body.filter((node) => !!("source" in node && node.source));
54
54
  }
55
55
  function rewriteImports(s, imports, entryMap, inputBase, entryFileNames, srcFilename) {
56
56
  const srcRel = path.relative(inputBase, srcFilename);
@@ -198,14 +198,8 @@ const IsolatedDecl = createUnplugin((rawOptions = {}) => {
198
198
  imports,
199
199
  map
200
200
  });
201
- const typeImports = program.body.filter((node) => {
202
- if (!("source" in node) || !node.source) return false;
203
- if ("importKind" in node && node.importKind === "type") return true;
204
- if ("exportKind" in node && node.exportKind === "type") return true;
205
- if (node.type === "ImportDeclaration") return !!node.specifiers && node.specifiers.every((spec) => spec.type === "ImportSpecifier" && spec.importKind === "type");
206
- return node.type === "ExportNamedDeclaration" && node.specifiers && node.specifiers.every((spec) => spec.exportKind === "type");
207
- });
208
- for (const { source } of typeImports) {
201
+ const importsInDts = filterImports(program);
202
+ for (const { source } of importsInDts) {
209
203
  const resolved = (await resolve(context, source.value, id))?.id;
210
204
  if (resolved && filter(resolved) && !outputFiles[stripExt(resolved)]) {
211
205
  let source$1;
package/dist/vite.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./transformer-CiAWE027.js";
2
- import { IsolatedDecl } from "./src-CLaOCtRu.js";
2
+ import { IsolatedDecl } from "./src-B5I0aiDn.js";
3
3
 
4
4
  //#region src/vite.ts
5
5
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unplugin-isolated-decl",
3
- "version": "0.13.8",
3
+ "version": "0.13.9",
4
4
  "description": "A blazing-fast tool for generating isolated declarations.",
5
5
  "type": "module",
6
6
  "keywords": [