Simple toy demo for sveltejs/svelte#196. Clone, then do this...
npm install
npm start
...then open localhost:3000.
First, we bundle shared/App.html
. This gives us a module (server/build/app.js
) which renders HTML. That module is used inside server/index.js
to respond to requests with server-rendered HTML (and scoped CSS).
Then, we bundle client/app.js
, which imports shared/App.html
. By initialising the client-side app with different data than the server uses, we can (for example) indicate that the app is now interactive, by rendering stuff differently.