Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

340
Vistas
Snowpack config only build modules from package.json

I am new to Snowpack (and frontend build tools in general), but I am looking for a solution to use my Node modules inside my client-side Javascript (using ESM syntax), and the idea of Snowpack bundling my modules in separate JS-files attracts me. This is my file structure:

/node_modules
/assets
  /css
  /js
  /img
  /lib
/views

*.config.js
package.json

I am interested in Snowpacks ability to build only my Node modules that I personally installed (what's inside my package.json) for use in the browser, and leave the rest of my application alone. I want Snowpack to put my files in the /assets/lib directory, but any configuration I try, it just doesn't work out. Snowpack takes my entire project folder, builds any module it finds, and puts it all inside my /assets/lib directory. With my limited knowledge of Snowpacks configuration, I've created this as my snowpack.config.js file:

module.exports = {
  buildOptions: {
    out: './assets/lib',
    baseUrl: './'
  },
};

If anyone with a little more experience in Snowpack than me could help me out with what I'm doing wrong here, it would be greatly appreciated!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you set the root folder in snowpack.config.js it will only build the contents of that folder to the out folder specified in buildOptions.

module.exports = {
    root: './assets/lib',
    buildOptions: {
        out: './assets/dist'
    },
};
about 4 years 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 vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda