1

I have a snowpack project with the following folder structure:

  • build : contains the built project
  • src : contains the source files
  • node_modules
  • package.json
  • snowpack.config.js

I set the following config:

// Snowpack Configuration File
module.exports = {
    mount: {
        "src": "/",
    }
};

This works when I use snowpack build: the files from src are neatly placed in the build folder and I can access it using the url http://localhost/myproject/build/index.html on my computer.

Problem: when I use snowpack dev, for some reason snowpack tries to find the build folder inside the src folder ?!?

404 ERROR /Users/oldhank/Sites/basics-snowpack/src/build/_snowpack/pkg/@tensorflow/tfjs

If I remove the config file the dev works too, but then I need to have all my project files in the root directory, which looks ugly?

How can I get both the dev and build commands working with a src and build folder?

Kokodoko
  • 26,167
  • 33
  • 120
  • 197

1 Answers1

0

Hope this helps anyone trying to dev + build + deploy (gh-pages) Snowpack apps: https://github.com/jgrizou/snowpack-boilerplate

Above link contains a boilerplate for Snowpack app.

Soiloui
  • 13
  • 4