-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: remote files can now be in your kit.alias locations #14096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: f614425 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
// TODO could files live in other directories, including node_modules? | ||
for (const dir of [config.kit.files.lib, config.kit.files.routes]) { | ||
const directories = [ | ||
config.kit.files.lib, | ||
config.kit.files.routes | ||
]; | ||
|
||
// Add alias directories | ||
for (const [, alias_path] of Object.entries(config.kit.alias)) { | ||
const resolved_path = path.resolve(cwd, alias_path); | ||
if (fs.existsSync(resolved_path)) { | ||
directories.push(resolved_path); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe with alias you can 'opt-in' to something in your node_modules
?
|
||
// Allow remote functions to be imported on the client side (they get transformed) | ||
if (REMOTE_FILE_PATTERN.test(path.basename(id))) return false; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find how lib
and routes
are doing this!
I'm probably missing something!
Could address #14077
Feel free to disagree.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits