Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
danielkcz opened this issue Jun 7, 2019 · 5 comments
Labels
kind: feature New feature or request topic: externals Related to configuring externals for Rollup

Comments

@danielkcz
Copy link
Contributor

danielkcz commented Jun 7, 2019

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
@swyxio
Copy link
Collaborator

swyxio commented Jun 7, 2019

this one comes from rollup which comes from node. tbh i'd like to suppress this output altogether if we're not even building UMD.

@danielkcz
Copy link
Contributor Author

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

@danielkcz danielkcz changed the title [Suggestion] No name was provided for external module [Suggestion] Allow to specify external modules Jun 8, 2019
@markerikson
Copy link
Collaborator

I'm playing around with trying to use TSDX with Redux Starter Kit, and the guessing behavior is pretty unhelpful. It's producing this output:

  (global = global || self, factory(global.ReduxStarterKit = {}, global.redux, global.createNextState, global.selectorator, global.reduxDevtoolsExtension, global.thunk));

Pretty sure none of those match the actual global names from the UMD builds of those respective libs. (Not that I expect a build tool to actually parse or come up with those correctly.)

@jaredpalmer
Copy link
Owner

Sounds good. —external makes sense

@agilgur5 agilgur5 changed the title [Suggestion] Allow to specify external modules [Suggestion] Allow specifying external module names for UMD -- rollup output.globals Mar 19, 2020
@agilgur5 agilgur5 changed the title [Suggestion] Allow specifying external module names for UMD -- rollup output.globals [Suggestion] Allow specifying external module names for UMD (rollup output.globals) Mar 19, 2020
@agilgur5 agilgur5 added the topic: externals Related to configuring externals for Rollup label Mar 20, 2020
@agilgur5
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: feature New feature or request topic: externals Related to configuring externals for Rollup
Projects
None yet
Development

No branches or pull requests

5 participants