question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Suggestion] Allow specifying external module names for UMD (rollup output.globals)

See original GitHub issue

Current Behavior

image

Expected behavior

It does guess the names correct in this case but a nicer output would be great. You may notice that guessed name for the last react-dom is not even visible. It could lead to unexpected results if it would guess in the wrong way.

Suggested solution(s)

I wonder why it’s not possible to specify externals in a similar fashion as microbundle does. Since it would be optional, it doesn’t make the whole experience of zero configuration any worse.

Additional context

Used in building the https://github.com/JustFly1984/react-google-maps-api

Your environment

Software Version(s)
TSDX 0.6.1
TypeScript 3.5.1
Browser N/A
Yarn 1.16.0
Operating System Windows x64

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
danielkczcommented, Jun 7, 2019

Well, as I said, why not to get inspired by microbundle? I like the way they tackled it in there with CLI option.

https://github.com/developit/microbundle#all-cli-options

0reactions
agilgur5commented, Mar 20, 2020

So tsdx.config.js was added in #183 and released in v0.9.

I think configuring Rollup’s output.globals and externals is much easier via that than via CLI, so I’m going to close this out

Read more comments on GitHub >

github_iconTop Results From Across the Web

rollup.js
js and webpack, you can use Rollup to compile to UMD or CommonJS format, and then point to that compiled version with the...
Read more >
Bundling with rollup a library that imports a legacy UMD ...
You can use the suggested output.globals option in your Rollup configuration to specify the correct global variable names for these modules.
Read more >
Code-splitting for libraries—bundling for npm with Rollup 1.0
To have external dependencies in a UMD or IIFE build, you also need to specify under which global variable names the external dependencies...
Read more >
An Introduction to the Rollup.js JavaScript Bundler
Rollup.js is a next-generation JavaScript module bundler from Rich Harris, the author of Svelte. It compiles multiple source files into a ...
Read more >
How to Create a Hybrid NPM Module for ESM and ...
When reading Node documentation, you read about Webpack and Rollup, ESM, CommonJS, UMD and AMD. You read that .mjs and .cjs extensions are ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found