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

125
Views
Webpack thinks classes in unused code are distinct

I have a class Vec2 which is used throughout my project. The function getBoundingBox() is unused:

let x = new Vec2();
export function getBoundingBox( prims, padding ) {
    let min = new Vec2( null, null );

when I run webpack (config below), every instance of Vec2 in the collated file is replaced by Vec2_Vec2, while the unused call in getBoundingBox() remains as Vec2, like so:

let x = new Vec2_Vec2();
export function getBoundingBox( prims, padding ) {
    let min = new Vec2( null, null );

The obvious fix is to remove the unused code, but I am curious if there is an option to automatically ignore unused code and not include it in the final output. My webpack config is below:

webpack 5.46.0
webpack-cli 4.7.2

{
  entry: {
    app: './build/app.js',
  },
  output: {
    filename: '[name].js',
    path: path.resolve('.', 'dist'),
  },
  devtool: 'inline-source-map',
  optimization: {
    minimize: false,
  },
}
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!