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.
How to specify the public HTML folder while adding Snowpack to an existing Node.js project?
...
I'm gettingNo webpage was found for the web address: http://localhost:8080/
in the browser.
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:
npx create-snowpack-app proj --template @snowpack/app-template-blank
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 the Root
of our existing project:
{
"mount": {
"public": "/",
"src": "/_dist_"
},
"plugins": []
}