Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1K
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda