Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

338
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda