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

77
Views
webpack is building a lots of files instead of one

When building my app with webpack to the ./dist folder, I get a lot of file whereas I'm expecting to have only one. My ./dist folder looks like:

657.main.js
657.main.js.LICENSE.txt
657.main.js.map
726.main.js
main.js
main.js.LICENSE.txt
main.js.map

When I'm expecting:

main.js

My webpack config is the following:

const path = require('path')

module.exports = {
  mode: 'production',
  devtool: 'source-map',
  entry:  './src/index.js',
  output: {
    filename: 'main.js',
    path: path.resolve(__dirname, 'dist'),
    library: 'foobar',
  }
}

When removing all other files except main.js I get errors.

Is there a way to build my app to only one file?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Webpack by default is chucking/code splitting the modules. You can disable/set max number of chunks it by using this plugin:

https://webpack.js.org/plugins/limit-chunk-count-plugin/

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!