How to specify the public HTML folder while adding Snowpack to an existing Node.js project?
My existing project structure:
Root
|-src/
|-public/index.html
I've added Snowpack:
npm install --save-dev snowpack
Then when running Snowpack dev server:
npx snowpack dev
I'm getting No webpage was found for the web address: http://localhost:8080/
in the browser.
I expected ./public/
to be the default web folder for Snowpack, but apparently it needs some configuration.
I'm new to Snowpack and I couldn't find an answer to this specific problem in the docs, so it took a bit of googling and experimenting. Answering to my future self:
If we create a blank Snowpack project from the template:
then we'll get
./proj/snowpack.config.json
, that's where we can set up or change the folder mapping, and we can copy this file to theRoot
of our existing project: