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

101
Vistas
JS/TS Non-glob import with prefix

I have been doing this all over:

import * as math from 'mathjs';

But that leads to the whole MathJS library in my Webpack bundle, so I'm trying to stop using * imports.

It is very nice, though, having the math prefix when I call a function, e.g. math.round or math.add. It helps distinguish a bunch of generic function names.

Can I have both named (non-glob) imports, and a prefix for all the functions coming from the same package?

I've tried

import { add, divide, parse, simplify, round } as math from 'maths';

But no luck.

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