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
0
votes
1 answer

Using locally develop npm module

I have developed a nodejs project as an umd library, with the purpose to use it in a another nodejs project. The library project builds fine and generates the index.js file and index.min.js file. But when I tried installing the library project…
Shashith Darshana
  • 2,715
  • 1
  • 25
  • 27
0
votes
0 answers

ES6 import still within an object after import - I've tried a dozen configurations. What am I overlooking?

I have quite a lot of experience with ES6 and imports, but I usually don't do imports and exports this way. I'm trying to understand what I'm overlooking here. I've done a lot of searching here, but no answers so far. Exporting my function from File…
Slbox
  • 10,957
  • 15
  • 54
  • 106
0
votes
1 answer

Ember js import a UMD node module

I have to import this library and have the "ZeroEx" variable global across all ember files. i tried to add this line in ember-cli-build.js but I got no such file or…
sparkle
  • 7,530
  • 22
  • 69
  • 131
0
votes
2 answers

Is it possible to import a bundled webpack and library separately using webpack?

I'm trying to build a module which uses d3, but I don't want to bundle d3 with that module and, crucially, I don't want to have to bind d3 to the window. The module is to be installed on another project with npm as a git dependency. On the module I…
Hello World
  • 1,102
  • 2
  • 15
  • 33
0
votes
0 answers

Ignore 'could not resolve ...' errors React Native

I am using this library in my React Native app, but I am having a problem as it tries to require crypto. In a node environment, require-ing an unavailable module would throw an Error, which could then be caught and handled. However, the packager…
John Leuenhagen
  • 576
  • 7
  • 23
0
votes
1 answer

TypeScript module types for UMD globals?

My TypeScript project is compiled for the browser with AMD modules. I include lodash.min.js myself, along with a bunch of other UMD libraries that all declare global variables, like moment and _. I need to tell my TypeScript about the global _…
Sam Claus
  • 1,807
  • 23
  • 39
0
votes
1 answer

Create both jQuery and vanilla Javascript plugin that supports UMD?

Is it possible to create a plugin that can be initialized both using jQuery and vanilla Javascript like for example: // jQuery $("#selector").plugin({ option1: "val1", option2: "val2" }); // Javascript var plugin = plugin("#selector", { …
Sosa
  • 814
  • 1
  • 9
  • 20
0
votes
1 answer

How to bundle javascript library implemented in Typescript that works in browser with require, import and