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 +1 -1
- package/dist/farm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/rolldown.js +1 -1
- package/dist/rollup.js +1 -1
- package/dist/{src-CLaOCtRu.js → src-B5I0aiDn.js} +3 -9
- package/dist/vite.js +1 -1
- package/package.json +1 -1
package/dist/esbuild.js
CHANGED
package/dist/farm.js
CHANGED
package/dist/index.js
CHANGED
package/dist/rolldown.js
CHANGED
package/dist/rollup.js
CHANGED
|
@@ -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) => (
|
|
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
|
|
202
|
-
|
|
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