Skip to content

Commit 1cafa91

Browse files
authored
chore: allow remote functions in all of the src directory (#14198)
uses the newly-added src option to our advantage. Helps with most of #14077, tbd on the node_modules stuff
1 parent 187a784 commit 1cafa91

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

.changeset/many-coins-lie.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
chore: allow remote functions in all of the src directory

packages/kit/src/core/sync/create_manifest_data/index.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -481,18 +481,14 @@ function create_remotes(config, cwd) {
481481
const remotes = [];
482482

483483
// TODO could files live in other directories, including node_modules?
484-
for (const dir of [config.kit.files.lib, config.kit.files.routes]) {
485-
if (!fs.existsSync(dir)) continue;
484+
for (const file of walk(config.kit.files.src)) {
485+
if (extensions.some((ext) => file.endsWith(ext))) {
486+
const posixified = posixify(path.relative(cwd, `${config.kit.files.src}/${file}`));
486487

487-
for (const file of walk(dir)) {
488-
if (extensions.some((ext) => file.endsWith(ext))) {
489-
const posixified = posixify(path.relative(cwd, `${dir}/${file}`));
490-
491-
remotes.push({
492-
hash: hash(posixified),
493-
file: posixified
494-
});
495-
}
488+
remotes.push({
489+
hash: hash(posixified),
490+
file: posixified
491+
});
496492
}
497493
}
498494

0 commit comments

Comments
 (0)