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

254
Views
Terser mantenga (no destruya) un nombre de función específico

¿Hay alguna manera de no alterar solo un nombre de función? Un comentario en el código sería más fácil, pero supongo que esto podría hacerse especificando un "nameCache" personalizado. Pero no sé cómo funciona eso.

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

No pude resolver esto, pero ya tenía el nombre de la función, así que almacené el nombre de la función en la página web en un atributo que pude encontrar más tarde con JavaScript. p.ej

 function bob() { console.log('hello'); } document.querySelector('#myid').setAttribute('data-function-name', bob.name);
 <span id="myid">for example make this style="display:none;"</span>

about 4 years ago · Santiago Trujillo Report

0

Para evitar que terser altere un símbolo en particular, debe agregarlo a la lista reservada de terser. Esto se puede hacer en su archivo de opciones de terser:

 { "mangle": { "properties": { "reserved": ["symbolToNotMangle", "anotherSymbolToPreserve"] } } }

Si aún no está usando un archivo de opciones de terser , lo guardaría en (por ejemplo) terser_options.json y le diría a terser que lo use así:

 terser ... --config-file terser_options.json

También puede enumerar los símbolos reservados en la línea de comando si lo prefiere:

 terser ... -m reserved=['symbolToNotMangle','anotherSymbolToPreserve']

https://github.com/terser/terser#cli-mangle-opciones

about 4 years ago · Santiago Trujillo 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!