umd Questions

3

Solved

I'm trying to build a umd library with webpack; regardless of what I do get a warning: WARNING in D:/Code/Node/sample.io/source/index.ts 3:24 Critical dependency: require function is used in a...
Isatin asked 15/7, 2016 at 9:33

1

Solved

I've found the(?) github repository for UMD and it comes with this description (emphasis mine): UMD (Universal Module Definition) patterns for JavaScript modules that work everywhere. ... This rep...
Billfish asked 12/10, 2023 at 20:55

2

I'm using rollup to bundle a library and I want to include external dependencies together with my code in the UMD bundle. I can't find any useful information about this in the docs. It could be tha...
Harridan asked 15/6, 2022 at 7:35

2

I am trying to get the Leaflet library to play well with my Typescript project. My project follows the commonJs pattern (imports\exports in my source files), but when I build with webpack, the com...
Woermer asked 24/2, 2018 at 8:40

6

Solved

Hi I am doing some research on RxJS. I am able to use the library simply by referencing it in my browser as such: <script src="https://unpkg.com/@reactivex/[email protected]/dist/global/Rx...

2

Solved

Quoting babel docs https://babeljs.io/docs/en/babel-standalone#usage : "If you want to use your browser's native support for ES Modules, you'd normally need to set a type="module" a...
Driscoll asked 14/9, 2020 at 11:49

0

In typescript there's this syntax to declare a 'bundle' of all of a module's exports as a UMD global namespace. From the docs: export function isPrime(x: number): boolean; export as namespace mathL...
Jinni asked 14/4, 2021 at 19:3

1

I am trying to build a module using the module-bundler ParcelJS. I would like this certain module to be import-friendly: it should be import friendly (ES6) It should be require friendly (Node) It...
Mold asked 23/5, 2018 at 14:36

3

Solved

I'm writing a lib with webpack with these settings: output: { path: path.join('build'), filename: 'my_lib.js', library: 'MyLib', libraryTarget: 'umd' }, MyLib: export default function() { ...
Abate asked 12/1, 2016 at 6:17

1

Solved

WARNING: No name was provided for external module 'moment' in output.globals – guessing 'momentImported' WARNING: No name was provided for external module 'odata-parser' in output.globals – guessin...
Hymie asked 24/4, 2020 at 6:56

1

I am trying to use handlebars in a client side javascript library that I am writing in typescript, when I use the import * as Handlebars from 'handlebars' I get an error message saying that typescr...
Marra asked 12/5, 2019 at 20:46

2

Solved

According to the Webpack 4 documentation, if I specify libraryTarget: 'umd' it should result in the following output: (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports...
Jeffers asked 5/3, 2018 at 13:0

1

I installed reactjs and react-dom like this with package.json "dependencies": { "bootstrap": "^v4.1.1", "popper.js": "^1.14.3", "react&quo...
Appreciation asked 8/7, 2018 at 15:2

2

I know how to init components using ComponentFactoryResolver.resolveComponentFactory(AComponentType) but the method expects a Type, while in my code I have the name of the type as a string. In th...
Hintz asked 8/3, 2018 at 8:7

4

Solved

Im authoring a TS library, and would like to export an instance of a class, I intend for it be used as singleton in the consuming application. Right now I have the following structure: index.ts ...
Felodese asked 24/1, 2019 at 16:42

1

How can I import a.js and b.js and export as combined bundle.js in UMD format using rollupjs? Here is the example: //a.js export default class A { ... } //b.js export default class B { ... } M...
Quarterage asked 4/6, 2018 at 16:40

2

Solved

I want to create a frontend library. Therefore I want to use webpack. I especially like the css and image loader. However I can only require non-JS files if I am using webpack. Because I am buildin...
Chronologist asked 28/12, 2016 at 10:9

2

Solved

I am working on the library surveyjs It uses gulp+webpack to build umd bundle. I want to create the type definition bundle (or may be just multiple d.ts files) for using in typescript projects. I...
Skilken asked 20/10, 2016 at 12:55

1

I am trying to build a simple file that depends on a library built with UMD exports. // main.ts import { parseTree } from 'jsonc-parser'; const tree = parseTree('{ "name: "test" }'); console.log...
Earthling asked 2/4, 2017 at 21:24

3

Solved

I have a project structure that contains a folder that I want to dynamically import into a UMD module when I build my webpack config and have each file be a submodule in the outputted build. For e...
Ocker asked 5/1, 2018 at 19:42

1

I have found a few StackOverflow questions related to this but none that match nor fix my problem. I am writing a library in ES6 that is intended to be used in the browser and on the server. I hav...
Repeated asked 17/5, 2016 at 6:57

1

Solved

Webpack generates the following UMD definition: (function webpackUniversalModuleDefinition(root, factory) { // this is CommonJS/Node if(typeof exports === 'object' && typeof module === '...
Felodese asked 12/10, 2017 at 11:6

1

I'm working on a typescript project that uses import/export style syntax for modules. I want to compile all the typescript files into a single file. Here is how my tsconfig.json looks like, { "co...
Joyous asked 20/1, 2017 at 3:11

1

Solved

How can I create a javascript file that contains an Angular 2 module that can be used by other applications, but is loaded at runtime directly from a centralized server and is NOT bundled into a sp...
Bak asked 16/12, 2016 at 18:22

1

With the recent version of Angular RC4, Rxjs is available with node_modules or npmcdn.com directory. Successful plunker but not using .umd.js http://plnkr.co/edit/B33LOW?f=systemjs.config.js&...
Amphimacer asked 5/8, 2016 at 15:55

© 2022 - 2024 — McMap. All rights reserved.