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

158
Views
How to tell webpack to follow dependencies while building/splitting custom chunks?

I'm new to webpack and eperimenting with code splitting. I would like to create more than one custom chunks, thus using cacheGroups like this:

  optimization: {
    minimize: true,
    splitChunks: {
      cacheGroups: {
        visuals: {
          name: 'visuals',
          chunks: 'all',
          test: /[\\/]node_modules[\\/](swiper|@fancyapps\/ui|dom7|ssr-window)[\\/]/
        },
        lowdash: {
          name: 'lowdash',
          chunks: 'all',
          test: /[\\/]node_modules[\\/]lodash[\\/]/
        }
      },
    }
  },

As you can see, on the first chunk, which is for swiper and fancybox, I'm adding also dom7 and ssr-window, which are swiper's dependencies. I was wondering: is there a way to tell webpack to follow all the package's dependencies? I mean, a way to tell webpack 'just pick swiper package and auto-include all its dependencies in the chunk, without he need to specifying them manually'?

about 4 years ago · Juan Pablo Isaza
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!