Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

153
Vistas
Snowpack 3.8 cannot find the source folder, running dev server with different root directory

I have a project structure like this:

enter image description here

When starting the dev server from root directory everything works perfectly. I would like my index.html file to be in the src directory, but then snowpack does not find the index.html file. When starting the snowpack dev server from inside the src directory it says it can not find the package.json file which is required.

Is there a possibility to start the snowpack dev server from my projects directory, but point to src as the root directory to be served?

I have tried the following configurations in snowpack.config.js

export default {
  root: "./src/index.html",
  mount: {
    src: "/src",
    public: "/",
  },
};
export default {
  mount: {
    public: { url: '/', static: true },
    src: { url: '/src' },
  },
};
export default {
  mount: {
    public: '/',
    src: '/src',
  },
};
7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If someone swing by having a similar problem, this link might help:

frontend build config generator

The generator created the following snowpack.config:

{
  "mount": {
    "dist": "/",
    "src": "/"
  }
}

After applying this configuration, Snowpack should work as requested.

7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.