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

157
Views
how to move all js package <script> tags from index.html into a single js file

I am trying to move my webEngage script into another file, so I can pass it as an entry point in my webpack. Here is what I already have in my index.ejs

<head>
 <meta charset="utf-8" />
 <meta
   name="viewport"
   content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"
 />
 <meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
<body>

<!-- ICONS SPRITE -->
<div style="display: none">
  <% if (htmlWebpackPlugin.files.sprites) { for (var spriteFileName in
  htmlWebpackPlugin.files.sprites) { %> <%=
  htmlWebpackPlugin.files.sprites[spriteFileName] %> <% } } %>
</div>
<div id="root"></div>
<noscript>
  scripts is disabled, please enable javascript and try again!
</noscript>

<!-- WebEngage Script -->
<script id="_webengage_script_tag" type="text/javascript">
  var webengage;
  !(function(w, e, b, n, g) {
    function o(e, t) {
      e[t[t.length - 1]] = function() {
        r.__queue.push([t.join('.'), arguments]);
      };
    }
    .
    .
    .
  })(window, document, 'webengage');
</body>

I was thinking of declaring an IIFE in a scripts.js file, but it didn't work. I would appreciate your help in advance

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