Skip to content

Commit

Permalink
fix: avoid loading dts files (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey authored Jan 11, 2024
1 parent 30ccff4 commit 86ca142
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions src/loader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ const WATCH_MISSING_FILES = [
basename: "component-browser",
has(meta: MarkoMeta): boolean {
return Boolean(
meta.deps &&
meta.deps.some(
dep =>
getBasenameWithoutExt(
(typeof dep === "object" && dep.virtualPath) ||
((dep as unknown) as string)
) === this.basename
)
meta.component ||
(meta.deps &&
meta.deps.some(
dep =>
getBasenameWithoutExt(
(typeof dep === "object" && dep.virtualPath) ||
((dep as unknown) as string)
) === this.basename
))
);
}
}
Expand Down Expand Up @@ -236,11 +237,11 @@ function getTrailingContent(

if (missingDeps.length) {
const templateFileName = getBasenameWithoutExt(resource);
result += `\nrequire.context(".", false, /\\${path.sep}${
result += `\nrequire.context(".", false, /\\/${
templateFileName === "index"
? ""
: `${escapeRegExp(templateFileName)}\\.`
}(?:${missingDeps.join("|")})\\.\\w+$/)`;
}(?:${missingDeps.join("|")})\\.[^d]\\w*$/)`;
}
}

Expand Down

0 comments on commit 86ca142

Please sign in to comment.