npm install
npm run dev
Sapper expects to find two directories in the root of your project — src and static.
The src directory contains the entry points — client.js, server.js and (optionally) a service-worker.js — along with a template.html file and a routes directory.
The static directory contains any static assets that should be available. These are served using sirv.
To start a production version, run npm run build && npm start. This will disable live reloading, and activate the appropriate bundler plugins.
You can deploy your application to any environment that supports Node 8 or above. As an example, to deploy to Now, run these commands:
npm install -g now
nowWhen using Svelte components installed from npm, such as @sveltejs/svelte-virtual-list, Svelte needs the original component source (rather than any precompiled JavaScript that ships with the component). This allows the component to be rendered server-side, and also keeps your client-side app smaller.
Because of that, it's essential that the bundler doesn't treat the package as an external dependency. You can either modify the external option under server in rollup.config.js or the externals option in webpack.config.js, or simply install the package to devDependencies rather than dependencies, which will cause it to get bundled (and therefore compiled) with your app:
npm install -D @sveltejs/svelte-virtual-list