-
Notifications
You must be signed in to change notification settings - Fork 0
Home
-
Initialize a SvelteKit project with the command and options below.
deno run -A npm:sv create --template minimal --types ts --no-add-ons --no-install deno-sveltekit-template cd deno-sveltekit-template/ -
Remove extraneous files when using Deno with the command below.
rm -f .npmrc
-
Migrate
package.jsontodeno.jsonc.-
Run the command below to add the dependencies in
package.jsontodeno.jsonc.mv package.json package.json.temp && deno add -D --allow-scripts npm:@sveltejs/adapter-auto npm:@sveltejs/kit npm:@sveltejs/vite-plugin-svelte npm:svelte npm:svelte-check npm:typescript npm:vite && mv deno.json deno.jsonc && mv package.json.temp package.json
-
Adjust package versions to match those defined in
package.json.- NB: Upgrading to the latest versions of packages causes
deno run devto fail the second time when loading the page in a browser. I am unsure which package is the culprit.
- NB: Upgrading to the latest versions of packages causes
-
Add
"nodeModulesDir": "auto"todeno.jsoncas instructed when running the command above and then rundeno install --allow-scriptsto generatenode_modules. -
Add
"$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json"todeno.jsonc.- Source: https://docs.deno.com/runtime/fundamentals/configuration/#json-schema.
- Follow the order of the properties in
deno.jsoncwith the schema.
-
Migrate
versiondirectly. -
Migrate
scriptsastasks. -
Remove
devDependenciesfrompackage.jsonsincedeno.jsonclists them asimports. -
Remove
namefrompackage.json. Adding a name property todeno.jsonccausesdeno install --allow-scriptsto warn thatexportsalso should be defined.- I might add
nametodeno.jsoncwhen I know what exactly it does and how it should be defined.
- I might add
-
Leave
"type": "module"inpackage.json. It prevents errors like the one below when adding a<style>tag to.sveltefiles.Error

-
-
Add type checking for a browser environment.
- Follow the instructions here: https://docs.deno.com/runtime/reference/ts_config_migration/#targeting-deno-and-the-browser.
-
Add
"checkJs": truetodeno.jsoncto type checksvelte.config.js.- This file cannot be a
.tsfile at the time of writing. See https://github.com/sveltejs/kit/issues/5867 for more information.
- This file cannot be a
-
Add Deno check, format, and lint tasks to
deno.jsonc."check": "deno check . && svelte-kit sync && svelte-check --tsconfig ./tsconfig.json""format": "deno fmt --unstable-component""lint": "deno lint"-
"exclude": [".svelte-kit/"]- This is needed to prevent
deno check .from type checking the.svelte-kit/directory.
- This is needed to prevent
-
Remove redundant
check:watchtask.- You can run this command with
deno run check --watch.
- You can run this command with
-
Refactor
README.mdto Deno.- All references to "npm" and "npx" have Deno counterparts.
-
Format files with
deno run format. -
Sort properties alphabetically.
-
Adjust files to achieve a perfect Lighthouse score.
- Add a <svelte:head> tag.
- Add a basic
robots.txtfile containingUser-agent: *andAllow: /.
-
compilerOptionsdiffers intsconfig.jsonanddeno.jsonc. -
deno fmthas "recommended" on by default.