Tsdx: Broken build with `tsdx build --format es`

Created on 26 May 2019  路  7Comments  路  Source: formium/tsdx

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

bug

All 7 comments

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.

--format=none

would also be useful

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

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

@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.

haha enjoy your vacation

This can be closed as well, per https://github.com/palmerhq/tsdx/pull/128 getting merged.

Was this page helpful?
0 / 5 - 0 ratings