sveltejs/sapper

Make sapper more versatile in allowing to specify individual files for client, server and service-worker

Closed this issue · 1 comments

When trying to integrate two sapper pages (one would be on a subroute) and one svelte application into one project I realized, that it is not possible to specify different client.js, server.js and service-worker.js files per sapper page in one sapper installation without breaking other functionalities of the sapper application. For example it is not possible to debug using node_modules/sapper/dist/cli.js dev. When changing only the client.js file in rollup.config.js client.input, then even the whole sapper build breaks and does not compile. Related to this. it could even be beneficial to have an option to set the desired rollup.config.js file in the sapper cli.

It would be very helpful to have a possibility to specify these files when running the sapper cli, or when debugging with node_modules/sapper/dist/cli.js dev. A configuration file like e.g. sapper.config.js which could be injected into the cli would even be more awesome. This would make the setup of multiple sapper pages much easier.

Alternatively I set up different sapper projects and have to create a shared folder structure where I can set up my components, scripts, styles, language files and content files and export each part of the pages/applications into a shared folder. This makes the setup and maintenance much more complicated.

Updated an example with minimal configuration to show the problem how it occurs. Example was build with sapper 0.28.7.
https://github.com/floratmin/sapper-subpage-example

I looked into the source code and realized that to make a change like this would make the project much more complicated. I consider now to use nx to manage my projects.