Questions tagged [umd]

Universal Module Definition (UMD) is an API for JavaScript modules that are capable of working in browsers, on the server, or elsewhere.

Universal Module Definition (UMD) is an API for JavaScript modules that are capable of working in browsers, on the server, or elsewhere.

The UMD pattern typically attempts to offer compatibility with the most popular script loaders of the day (RequireJS, CommonJS, and others). In many cases it uses AMD as a base, with special-casing added to handle CommonJS compatibility.

See the GitHub repo for more information.

198 questions
2
votes
2 answers

How do use RxJS with type definitions when using the UMD build?

For instance : npm i @reactivex/rxjs Create a index.ts file with some function that use RxJs Create an index.html file that reference RxJs UMD build and the index.js file created by the typescript compiler from the index.ts one. here there is a…
Valerio
  • 51
  • 3
2
votes
1 answer

Webpack 4 - Unable to properly transpile ES6 to UMD

I'm trying to migrate an older library to use ES6 imports/exports (eg. replacing const SomeClass = require('./SomeClass') to import SomeClass from './SomeClass'). The problem is that when I try to use the generated umd lib package, a Module instance…
user3845133
2
votes
1 answer

Typescript issue using 'this' inside class constructor for instance method

I have a very simple use case in TypeScript: A class, with a constructor, and an instance method. I want to call this instance method from the constructor, but using "this" resolves incorrectly. What is the proper way to have a class with…
Richard Duerr
  • 566
  • 8
  • 24
2
votes
1 answer

How to save reference to "this" in Vue component?

I'm not sure if I'm doing this properly. Please have a look at this simple Vue component Test.vue: