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

Broken build with tsdx build --format es #114

Closed
techniq opened this issue May 26, 2019 · 7 comments
Closed

Broken build with tsdx build --format es #114

techniq opened this issue May 26, 2019 · 7 comments
Labels
kind: bug Something isn't working

Comments

@techniq
Copy link

techniq commented May 26, 2019

Current Behavior

In an attempt to speed up my builds (and not need the other formats), I attempted to only build for es by changing the build script in package.json to tsdx build --format es but in doing so, it fails with

(node:89396) UnhandledPromiseRejectionWarning: Error: You must supply an options object to rollup

image

I thought this might be fixed by this commit in 0.5.10 but even on 0.5.11 it still shows the issue (I did a fresh project with npx tsdx create tsdx-test to verify it wasn't anything in my project specifically).

Expected behavior

To be able to only build a specific format (and possibly any other way so to optimize). My builds jumped from less than 2 minutes for the full pipeline (not just npm run build) to between 7-8 minutes after changing to tsdx (along with migrating to 99% typescript from ~30% prior). I could see having more Typescript code causing it to be a little slower, but not to this magnitude. I was only performing 1 build before, so I'm hoping going back to that will improve my tsdx build times.

Suggested solution(s)

I thought this commit was the fix, but not sure where the issue is now.

Your environment

Software Version(s)
TSDX 0.5.11
TypeScript 3.1.6
Browser Chrome
npm 6.8.0
Operating System Mac
@techniq
Copy link
Author

techniq commented May 28, 2019

The root issue appears to be if you exclude cjs from the formats, so tsdx build --format cjs,es works, but not just tsdx build --format es due to inputOptions being null here.

Excluding umd using --format=cjs,es has dropped a minute or so off my builds, which helps.

@jbadeau
Copy link

jbadeau commented May 29, 2019

--format=none

would also be useful

@swyxio
Copy link
Collaborator

swyxio commented May 29, 2019

@techniq it sounds like you're pretty close to a solution, want to propose a fix?

@jaredpalmer
Copy link
Owner

Seems like a straight forward fix. Can someone open a PR?

@techniq
Copy link
Author

techniq commented May 29, 2019

@sw-yx @jaredpalmer I don't have time right now (trying to hammer out some items before going on vacation -- just went went form 27% to 99% Typescript in a project and having to update a lot of my components accordingly, along with providing actual features).

If it's still open in a few weeks I can take a stab at it. My workaround is getting me by for now.

@swyxio
Copy link
Collaborator

swyxio commented May 29, 2019

haha enjoy your vacation

@hedgerh
Copy link
Contributor

hedgerh commented Jun 3, 2019

This can be closed as well, per #128 getting merged.

@swyxio swyxio closed this as completed Jun 3, 2019
@agilgur5 agilgur5 added the kind: bug Something isn't working label Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants