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

154
Vistas
WebCompiler extension for Visual Studio adding undesired code to minified JS scripts

I have a .NET MVC application, for which I use the (2022 version of the) WebCompiler extension for Visual Studio 2022, in order to minify my CSS et JS files.

When the JS scripts get minified, it seems like the extension is adding some undesired pieces of code to the resulting script. Things like :

function _toConsumableArray(n){if(Array.isArray(n)){for(...

Or even :

return regeneratorRuntime.async(function(o){for...

I'm assuming it does this because, for some random reason, it seems to beleive I'm using some kind of JS technology other than simple classic web JavaScript, like Node JS, Babel or whatever.

And this is causing issues on the client side obsiously, with errors like regeneratorRuntime not being defined.

Is there a way to prevent the extension from doing that ? Are there reserved keywords that can be used with other JS technologies that would make the extension beleive it's using that technology and that I should avoid using in my scripts ? Is there any other viable JS minifying extension that works with VS 2022 ? It seems like WebCompiler is discontinued.

I searched the compilerconfig.json.defaults file, but it doesn't seem to contain any option regarding this, nor does compilerconfig.json.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

So I found out what was causing the regeneratorRuntime thing to appear, it was the use of the async/await keywords.

I removed the async from my function declaration, and used then() instead of await, and the regeneratorRuntime went away.

The _toConsumableArray thing is still there, probably caused by something else, but this one isn't causing any client side error, so I can live with it.

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