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

Incremental compilation doesn't seem to work properly #684

Closed
koluch opened this issue Jan 17, 2021 · 1 comment
Closed

Incremental compilation doesn't seem to work properly #684

koluch opened this issue Jan 17, 2021 · 1 comment

Comments

@koluch
Copy link

koluch commented Jan 17, 2021

Hi!

I am trying to use incremental build feature to implement custom development setup, but it doesn't seem to work properly. I am using example from documentation:

async function example() {
  console.log('start');

  let result = await require('esbuild').build({
    entryPoints: ['app.js'],
    bundle: true,
    outfile: 'out.js',
    incremental: true,
  });

  // Call "rebuild" as many times as you want
  for (let i = 0; i < 5; i++) {
    console.log('before rebuild');
    await result.rebuild();
    console.log('after rebuild'); // <- this would never print
  }

  // Call "dispose" when you're done to free up resources.
  result.rebuild.dispose();

  console.log('finish');
}

example();

When I call await result.rebuild(), node process exists. I tried this on node 10 and 14, same results. Oddly, when I add setTimeout(() => {}, 5000); at the top of the file, program works as expected

@evanw
Copy link
Owner

evanw commented Jan 17, 2021

This was a regression that was introduced by a recent 3rd-party contribution: #656. I have already identified and fixed the issue: 0d50bbb. The fix hasn't been released yet but it will be in the next release.

@evanw evanw closed this as completed Jan 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants