本页还没有译文
本页 4 段还没译成日本語,下面显示的是英文原文。#lib
还没翻译译自英文(svelte.dev)本页 4 段都还没译
When scaffolding a new SvelteKit project through the sv CLI, it automatically creates a #lib import alias for your src/lib directory, by adding the following to your package.json:
{
"imports": {
"#lib": "./src/lib/index.js",
"#lib/*": "./src/lib/*"
}
}The # prefix leverages Node's built-in subpath imports feature, which reserves # for package-internal aliases. Vite and TypeScript both resolve these natively.
src/lib/Component.svelte
A reusable componentsrc/routes/+page.svelte
<script>
import Component from '#lib/Component.svelte';
</script>
<Component />AI 翻译查看英文原文