esbuild-loader icon indicating copy to clipboard operation
esbuild-loader copied to clipboard

Add support for stopping the ESBuild service on Webpack shutdown

Open Cyberboss opened this issue 7 months ago • 2 comments

Calling the new stop API mentioned in the release notes: https://github.com/evanw/esbuild/releases/tag/v0.19.11

Cyberboss avatar Jan 16 '24 14:01 Cyberboss

Can you tell me more about the motivation of this change?

Few thoughts:

  • In most cases, this shouldn't be necessary as the loader is loaded by Webpack to build and exit. I'm thinking it only makes sense if Webpack is loaded via Node API.
  • Does this exit in Webpacks watch mode?
  • Will esbuild be re-spawned if used after exit is called?
  • We allow custom esbuild to be passed in. So this stop method will have to be supported there too. Maybe update implementation to accept the entire esbuild export (e.g. import * as esbuild from 'esbuild') Note this will need to be backwards compatible with just passing in transform.

privatenumber avatar Jan 17 '24 03:01 privatenumber

I'm pulling out the esbuild upgrade here as the tests need to be updated: https://github.com/privatenumber/esbuild-loader/pull/355

privatenumber avatar Jan 17 '24 03:01 privatenumber

Closing due to lack of activity

privatenumber avatar Apr 08 '24 12:04 privatenumber