Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

337
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!