{"id":82,"date":"2026-02-14T23:44:08","date_gmt":"2026-02-14T14:44:08","guid":{"rendered":"https:\/\/www.ohe-lab.jp\/?p=82"},"modified":"2026-02-15T07:37:36","modified_gmt":"2026-02-14T22:37:36","slug":"svelte%e3%83%bbsveltekit%e3%81%a7%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%9f%e3%83%b3%e3%82%b0%ef%bc%882%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.ohe-lab.jp\/?p=82","title":{"rendered":"Svelte\u30fbSvelteKit\u3067\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\uff082\uff09"},"content":{"rendered":"\n<h2 class=\"wp-block-heading has-swl-main-color has-white-background-color has-text-color has-background has-link-color wp-elements-9750056d369b135de17d9cc2a6b6d4ee\">\u91cd\u8981\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u9020\u3068\u30d5\u30a1\u30a4\u30eb\u306e\u78ba\u8a8d<br><a href=\"https:\/\/svelte.dev\/tutorial\/kit\/introducing-sveltekit#Project-structure\">https:\/\/svelte.dev\/tutorial\/kit\/introducing-sveltekit#Project-structure<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30c8\/package.json\n<ul class=\"wp-block-list\">\n<li>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f9d\u5b58\u95a2\u4fc2\uff08svelte\u3084 \u3092\u542b\u3080@sveltejs\/kit\uff09\u3068\u3001SvelteKit CLI\u3068\u9023\u643a\u3059\u308b\u305f\u3081\u306e\u69d8\u3005\u306ascript \u304c\u4e00\u89a7\u8868\u793a\u3055\u308c\u308b\u3002&#8221;svelte&#8221;: &#8220;^5.49.2&#8221; \u306a\u3069\u3067\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u308f\u304b\u308b\u3002<\/li>\n\n\n\n<li>&#8220;type&#8221;: &#8220;module&#8221;\u3000\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3067\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u5f93\u6765\u306e CommonJS \u5f62\u5f0f\u3067\u306f\u306a\u304f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u30cd\u30a4\u30c6\u30a3\u30d6 JavaScript \u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u3053\u3068\u304c\u308f\u304b\u308b\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30c8\/svelte.config.js\n<ul class=\"wp-block-list\">\n<li>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u8a2d\u5b9a\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u304c\u3001\u5f53\u9762\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u3064\u3044\u3066\u306f\u6c17\u306b\u3059\u308b\u5fc5\u8981\u306f\u306a\u3044\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30c8\/vite.config.js\n<ul class=\"wp-block-list\">\n<li>Vite\u306e\u8a2d\u5b9a\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002SvelteKit\u306fVite\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u30db\u30c3\u30c8\u30e2\u30b8\u30e5\u30fc\u30eb\u7f6e\u63db\u3001TypeScript\u30b5\u30dd\u30fc\u30c8\u3001\u9759\u7684\u30a2\u30bb\u30c3\u30c8\u51e6\u7406\u306a\u3069\u306eVite\u306e\u6a5f\u80fd\u3092\u5229\u7528\u3067\u304d\u308b\u3002\u3061\u306a\u307f\u306bVite\u306f\u3001\u975e\u5e38\u306b\u9ad8\u901f\u306a\u30d3\u30eb\u30c9\u30c4\u30fc\u30eb\u3067\u3001\u958b\u767a\u6642\u306e\u9ad8\u901f\u306a\u30b5\u30fc\u30d0\u30fc\u8d77\u52d5\u3068 HMR\uff08Hot Module Replacement\uff09\u3001\u305d\u3057\u3066\u672c\u756a\u7528\u306e\u30d3\u30eb\u30c9\u306e\u6700\u9069\u5316\u304c\u306a\u3055\u308c\u308b\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>src\u30d5\u30a9\u30eb\u30c0\n<ul class=\"wp-block-list\">\n<li>\u30a2\u30d7\u30ea\u306e\u30bd\u30fc\u30b9 \u30b3\u30fc\u30c9\u304c\u914d\u7f6e\u3055\u308c\u308b\u5834\u6240<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>src\/app.html\n<ul class=\"wp-block-list\">\n<li>\u30da\u30fc\u30b8 \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u3001SvelteKit \u306f\u5fc5\u8981\u306b\u5fdc\u3058\u3066%sveltekit.head%\u3068%sveltekit.body%\u3092\u9069\u5207\u306a\u5185\u5bb9\u306b\u7f6e\u304d\u63db\u3048\u308b)\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>src\/lib\n<ul class=\"wp-block-list\">\n<li>\u30e9\u30a4\u30d6\u30e9\u30ea\u30b3\u30fc\u30c9\uff08$lib\u30a8\u30a4\u30ea\u30a2\u30b9\u7d4c\u7531\u3067\u30a4\u30f3\u30dd\u30fc\u30c8\u53ef\u80fd\uff09\u3002<\/li>\n\n\n\n<li><code>&lt;pre><\/code>export function bar() {\/\/something to do}<\/li>\n\n\n\n<li><\/li>\n\n\n\n<li><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>src\/routes\n<ul class=\"wp-block-list\">\n<li>\u30a2\u30d7\u30ea\u306e\u30eb\u30fc\u30c8\u3092\u5b9a\u7fa9\u3059\u308b\u3002<\/li>\n\n\n\n<li>\u30da\u30fc\u30b8\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3084\u305d\u306e\u30da\u30fc\u30b8\u5185\u3067\u5229\u7528\u3055\u308c\u308b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3084JavaScript\u30d5\u30a1\u30a4\u30eb\u306a\u3069\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>src\/routes\/+layout.svelte\n<ul class=\"wp-block-list\">\n<li>src\/routes\/\u3000\u306e\u914d\u4e0b\u306b\u3042\u308b\u3059\u3079\u3066\u306e+page.svelte\u30d5\u30a1\u30a4\u30eb\u306b\u9069\u7528\u3055\u308c\u308b\u5171\u901a\u306e\u8a18\u8ff0\u3092\u3053\u3053\u306b\u8a18\u8ff0\u3059\u308b\u3002<\/li>\n\n\n\n<li>+layout.svelte\u306f\u3001routes\u30d5\u30a9\u30eb\u30c0\u306e\u914d\u4e0b\u306e\u30d5\u30a9\u30eb\u30c0\u306b\u3082\u30cd\u30b9\u30c8\u3057\u3066\u914d\u7f6e\u3067\u304d\u308b\u3002\u305d\u306e\u5834\u5408\u306b\u306f\u3001\u305d\u306e\u914d\u7f6e\u4f4d\u7f6e\u306b\u3042\u308b+page.svelte\u30d5\u30a1\u30a4\u30eb\u3068\u305d\u306e\u914d\u7f6e\u30d5\u30a9\u30eb\u30c0\u914d\u4e0b\u306e\u3059\u3079\u3066\u306e+page.svelte\u30d5\u30a1\u30a4\u30eb\u306b\u9069\u7528\u3055\u308c\u308b\u3002<\/li>\n\n\n\n<li>+layout.svelte\u306e\u5192\u982d\u306b\u306f<br>&lt;script lang=&#8221;ts&#8221;&gt; let { children } = $props(); &lt;\/script&gt;<br>\u3092\u8a18\u8ff0\u3057\u3001+page.svelte\u30d5\u30a1\u30a4\u30eb\u306f\u8aad\u307f\u8fbc\u307e\u308c\u308b\u5834\u6240\u306b\u3001<br>{@render children()}\u3000\u3092\u8a18\u8ff0\u3059\u308b\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>static\n<ul class=\"wp-block-list\">\n<li>\u30a2\u30d7\u30ea\u306e\u30c7\u30d7\u30ed\u30a4\u6642\u306b\u542b\u3081\u308b\u5fc5\u8981\u306e\u3042\u308b\u30a2\u30bb\u30c3\u30c8 ( robots.txt\u3084favicon.png\u306a\u3069) \u304c\u542b\u307e\u308c\u308b\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"600\" src=\"https:\/\/www.ohe-lab.jp\/wp-content\/uploads\/2026\/02\/svelte-initial-tree-01-1024x600.jpg\" alt=\"\" class=\"wp-image-87\" srcset=\"https:\/\/www.ohe-lab.jp\/wp-content\/uploads\/2026\/02\/svelte-initial-tree-01-1024x600.jpg 1024w, https:\/\/www.ohe-lab.jp\/wp-content\/uploads\/2026\/02\/svelte-initial-tree-01-300x176.jpg 300w, https:\/\/www.ohe-lab.jp\/wp-content\/uploads\/2026\/02\/svelte-initial-tree-01-768x450.jpg 768w, https:\/\/www.ohe-lab.jp\/wp-content\/uploads\/2026\/02\/svelte-initial-tree-01-1536x901.jpg 1536w, https:\/\/www.ohe-lab.jp\/wp-content\/uploads\/2026\/02\/svelte-initial-tree-01-2048x1201.jpg 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><br>Screenshot<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading has-swl-main-color has-white-background-color has-text-color has-background has-link-color wp-elements-955dcbdaa98b538cecd63691f764b1d4\">\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\uff08URL\u3054\u3068\u306e\u30da\u30fc\u30b8\u8868\u793a\u3084\u5b9f\u884c\uff09<br><a href=\"https:\/\/svelte.dev\/tutorial\/kit\/pages\">https:\/\/svelte.dev\/tutorial\/kit\/pages<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SvelteKit \u306f\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u30d9\u30fc\u30b9\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u4f7f\u7528\u3059\u308b\u3002\u3064\u307e\u308a\u3001\u30a2\u30d7\u30ea\u306e\u30eb\u30fc\u30c8(\u3064\u307e\u308a\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u7279\u5b9a\u306e URL \u306b\u79fb\u52d5\u3057\u305f\u3068\u304d\u306b\u30a2\u30d7\u30ea\u304c\u5b9f\u884c\u3059\u308b\u52d5\u4f5c) \u306f\u3001\u30b3\u30fc\u30c9\u30d9\u30fc\u30b9\u5185\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u3088\u3063\u3066\u5b9a\u7fa9\u3055\u308c\u308b\u3002<\/li>\n\n\n\n<li>src\/routes\u5185\u306e\u3059\u3079\u3066\u306e+page.svelte\u30d5\u30a1\u30a4\u30eb\u306f\u30a2\u30d7\u30ea\u5185\u306e\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3059\u308b\u3002\n<ul class=\"wp-block-list\">\n<li>src\/routes\/+page.svelte\u3068\u3044\u30461\u3064\u306e\u30da\u30fc\u30b8\u304c\u3042\u308a\u3001\u3053\u308c\u306f \/ \u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3055\u308c\u3066\u3044\u308b\uff08http:\/\/localhost:5173\/\u3000\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3068\u304d\u306b\u8868\u793a\u3055\u308c\u308b\u3002\uff09<\/li>\n\n\n\n<li>\u305f\u3068\u3048\u3070\u3001\/about\uff08http:\/\/localhost:5173\/about\uff09\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3068\u304d\u306e\u6319\u52d5\u306f\u3001src\/routes\/about\/+page.svelte \u306b\u8a18\u8ff0\u3055\u308c\u308b\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>\u5f93\u6765\u306e\u30de\u30eb\u30c1\u30da\u30fc\u30b8\u30a2\u30d7\u30ea\u3068\u306f\u7570\u306a\u308a\u3001\/about\u30b7\u30f3\u30b0\u30eb\u30da\u30fc\u30b8\u30a2\u30d7\u30ea\u306e\u3088\u3046\u306b\u3001\u30da\u30fc\u30b8\u9593\u306e\u79fb\u52d5\u3084\u30da\u30fc\u30b8\u306b\u623b\u308b\u3068\u73fe\u5728\u306e\u30da\u30fc\u30b8\u306e\u5185\u5bb9\u304c\u66f4\u65b0\u3055\u308c\u308b\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30b5\u30fc\u30d0\u30fc\u5074\u3067\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3055\u308c\u305f\u9ad8\u901f\u306a\u8d77\u52d5\u3068\u3001\u77ac\u6642\u306e\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3068\u3044\u3046\u3001\u4e21\u65b9\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u4eab\u53d7\u3067\u304d\u308b\uff08\u3053\u306e\u52d5\u4f5c\u306f<a href=\"https:\/\/svelte.dev\/docs\/kit\/page-options\" target=\"_blank\" rel=\"noreferrer noopener\">\u8a2d\u5b9a\u53ef\u80fd<\/a>\u3067\u3059\u3002\uff09<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u91cd\u8981\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u9020\u3068\u30d5\u30a1\u30a4\u30eb\u306e\u78ba\u8a8dhttps:\/\/svelte.dev\/tutorial\/kit\/introducing-sveltekit#Project-structure \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\uff08URL\u3054 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[5],"tags":[22,20,21,23],"class_list":["post-82","post","type-post","status-publish","format-standard","hentry","category-it-ai","tag-programing","tag-svelte","tag-sveltekit","tag-web"],"_links":{"self":[{"href":"https:\/\/www.ohe-lab.jp\/index.php?rest_route=\/wp\/v2\/posts\/82","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ohe-lab.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ohe-lab.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ohe-lab.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ohe-lab.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=82"}],"version-history":[{"count":8,"href":"https:\/\/www.ohe-lab.jp\/index.php?rest_route=\/wp\/v2\/posts\/82\/revisions"}],"predecessor-version":[{"id":98,"href":"https:\/\/www.ohe-lab.jp\/index.php?rest_route=\/wp\/v2\/posts\/82\/revisions\/98"}],"wp:attachment":[{"href":"https:\/\/www.ohe-lab.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=82"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ohe-lab.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=82"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ohe-lab.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}