Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda