server-side imports
MODIFY
examples/hn.svelte.dev/src/components/Nav.svelte
examples/hn.svelte.dev/src/components/Nav.svelte
<script>
+// import { goto } from '@sveltejs/kit/client';
+ import * as module from '@sveltejs/kit/client';
+
+// console.log('goto', goto)
+ console.log('module', module)
+
export let segment;
</script>

MODIFY
packages/kit/package.json
packages/kit/package.json
"snowpack": "^2.15.1"
},
"devDependencies": {
- "@types/node": "^14.11.10",
+ "@types/node": "12",
"@types/sade": "^1.7.2",
"estree-walker": "^2.0.1",
"kleur": "^4.1.3",

MODIFY
packages/kit/tsconfig.json
packages/kit/tsconfig.json
{
"compilerOptions": {
- "noEmit": true,
"resolveJsonModule": true,
"module": "esnext",
"moduleResolution": "node",
"target": "ES6",
"outDir": "build",
- "esModuleInterop": true
+ "esModuleInterop": true,
+ "noEmit": true,
+ "declarationDir": "declarations",
+ "declaration": true
},
"lib": ["ES2020", "dom", "node"]
}

MODIFY
packages/snowpack-config/snowpack.config.js
packages/snowpack-config/snowpack.config.js
@@ -25,6 +25,7 @@ module.exports = {
'src/setup': '/_app/setup'
},
alias: {
+ '@sveltejs/kit': '/_app/main',
$components: './src/components'
}
};
\ No newline at end of file

server-side imports