# esbuild-empty-file-test **Repository Path**: mirrors_mjackson/esbuild-empty-file-test ## Basic Information - **Project Name**: esbuild-empty-file-test - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-25 - **Last Updated**: 2026-05-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README This is a repro of what I think might be a bug in esbuild where it interprets an empty file as a module with a `default` export when it is imported via `import *`. To reproduce: - Make sure you have node 14 or newer (so you can run ESM w/out compiling anything) - Run `b.mjs` with node: ```sh $ node b.mjs ``` You should see the following console output: ```log [Module] { } ``` It's an empty module (no exports). - Next, run install + esbuild: ```sh $ npm install $ esbuild --bundle --outfile=out.js b.mjs ``` - Now, run the esbuild output: ```sh $ node out.js ``` You should see the following console output: ```log { default: {} } ``` The built module is an object with a single `default` export which is an empty object.