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

106
Views
Simple Typescript es5 library

I am really confused about how to create a simple es5 library that is not loaded as a module but rather like an old-fashioned iife.

All I am trying to do is to create a single file that will be included in the html

<script src="foo.js" type="text/javascript" />

and then be able to instantiate the function

var f = new Foo();

I am using webpack to bundle the assets.

Do I need babel to polyfill to an iife or am I missing something else?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Usually the library injects the class into the browser's global variable. May be you shoud add this in your lib code.

class Foo {

}
window.Foo = Foo

For example: This is how jquery does it.

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