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
Watch mode and entryNames including a hash #1186
Comments
The latest release includes |
Hi @evanw, thanks! I'm trying to get it working, however I can't get // build.js
require('esbuild').build({
entryPoints: ['app.js'],
outdir: 'out',
watch: true,
incremental: true,
plugins: [
{
name: 'test',
setup(build) {
build.initialOptions.metafile = true;
build.onEnd(result => {
console.log('onEnd', result.metafile);
});
},
},
],
});
// -------------
// app.js
console.log('test'); The What am I missing? |
I've used the watch callback function to generate the manifest and clean-up old files until this is fixed in the plugins API. |
It looks like watch: { onRebuild() {} }, |
The fix should now be published in version 0.11.16. |
I've just tried the new release and the problem is not that |
This issue should be fixed in the latest release by the way. Thanks for the report. |
Awesome, thanks! |
Thank you for this, getting access to the metafile in rebuilds was a game-changer for us and made using esbuild's watch mode possible for our team in development. |
Even for the development mode I use a hash in the entry points to enable proper caching, which is especially important when working on loading performance improvements.
When the watch mode is on, esbuild will keep creating new files upon each change without removing the old generated files. Shouldn't the watch mode take care of automatically removing files generated by previous builds?
Also, I miss a plugin that would generate some sort of manifest JSON file mapping the generated entry point bundle for each entry point. Our server application runs Ruby, not JavaScript, so the application must know how to find the right bundle for each supported entry point. Are there built-in plugins that would take care of removing old files generated by previous builds and generating some manifest JSON file for use with a generic web server?
The text was updated successfully, but these errors were encountered: