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.

Broken build with `tsdx build --format es`

See original GitHub issue

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

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
sw-yxcommented, May 29, 2019

haha enjoy your vacation

1reaction
techniqcommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change Log - TSDX
An upstream cache bug that affected certain combinations of build formats has been fixed. The error that was fixed would look similar to:...
Read more >
Jared Palmer on Twitter: "TSDX 0.7.x is out with better ES module ...
Breaking Changes TSDX will no longer build a UMD bundle by default, you now must specify it using the --format=umd,esm,cjs Renamed es format...
Read more >
Rollup Config for React Component Library With TypeScript + ...
Prior to this, I was using Webpack to build the library. Had a lot of hustles in getting my first working version back...
Read more >
Comparison of Build Tools - SurviveJS
StealJS is a dependency loader and a build tool focusing on performance and ease of use. Blendid is a blend of Gulp and...
Read more >
Build your First Typescript Package in Under 10 Minutes
Then I stumbled onto TSDX. After reading the README, I was able to publish an npm package complete with tests in a single...
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