I am using Sapper with Svelte to create a static website.
Because my website is static, I won't be bothering with a server and will use the sapper export
command to generate static files which I can host on GitLab pages.
I have therefore removed the server.js
file in my src
directory - it shouldn't be necessary. However, when I run the export command, it fails with the following error:
Why is this looking for a server and how to I fix this?
I also tried removing the server
option in rollup.config.js
, however this now complains that the client
, server
and serviceworker
properties are required.
When you run sapper export
, it creates the static build by running your server and crawling your site. For that reason, you do need server.js. (This might change in a future version.)