Develop New Features Locally
Explore the process of developing new features locally by integrating Firebase Hosting with Sapper. Learn to configure development scripts, handle Firebase reserved URLs, and run local servers with live reloading to streamline your cloud-native web app development.
We'll cover the following...
Local development
This is a good time to discuss how to develop new features. By default, Sapper web applications have a dev NPM script. To start the development server, run the following commands in the services/web directory.
npm install
npm run dev
Network requests fail
Due to the Firebase reserved URLs “/__/” that make it simpler to initialize our web application when it is deployed to Firebase Hosting, you might notice a few requests that fail with a “404 Not Found” response in the Network tab in your browser development tools.
Locally, Sapper does not know anything about these reserved URLs. We need to teach our local server what to do when it encounters such a URL.
Fixing the network requests failing
To fix the issue with the “/__/” URLs we can leverage the firebase serve CLI command. As always, we start with an ...