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

1K
Vistas
Is this correct syntax in requireJs

I am using some libraries where I cannot change the js file as this is third party in the js file the library is so coded that if requireJs is used that the library is loaded in different manner below is the code from the library I have changed to keep things simple

;(function(root, factory) {
 if (typeof define === 'function' && define.amd) { // AMD
 define(["./abc_compressed.js"], factory);
 } else if (typeof exports === 'object') { // Node.js
    module.exports = factory(require("./abc_compressed.js"));
     } else { // Browser
               var factoryExports = factory(root.ABC);
            root.ABC.library = factoryExports;
             }
       }(this, function(_parent_) {
                        //Do many things here
                        return $.ABC.library;
                        }));

I have read requireJs and no where I could find an example where in the dependent module the extension .js is used.

So need help to understand if the syntax in the third party is correct. If correct what setup in path I need do in requireJs setup so that the dependent module is loaded

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