Hi folks, it’s my first post here, but I’ve been following this forum for a while now.
I’m facing some discrepancies on Static File serving between the netlify-cli dev command and the production version, the site is https://trygracias.netlify.app/.
I have an index.html file in the folder public/single-button with the following header:
Is there a specific reason why you need the --live flag? Just trying to make sure it’s not some configuration mistake. If you’re using CLI for local testing, you should not need that flag.
@hrishikesh is there any configuration that can be done to force the static file hosting to always use the public folder as the root?
So in this way I’ll always use:
I was able to make both, netlify dev and netlify dev --live, have the same behavior as the production serving by setting up my own static server and configuring the dev section on the netlify.toml.
Step by step:
First: install live-server from npm: npm i -g @compodoc/live-server
Second: configure the netlify.toml by adding the following [dev] section, you may need to adapt it depending on your folder structure: