esbuild-fix-imports-plugin
Version:
An ESBuild plugin that fixes import paths by applying fixAliasPlugin, fixFolderImportsPlugin, and fixExtensionsPlugin. It ensures correct file extensions, resolves path aliases, and fixes directory imports in your build output when using 'tsup' with 'bund
19 lines • 618 B
TypeScript
import { type Plugin } from "esbuild";
/**
* ESBuild plugin that replaces import paths pointing to directories
* with explicit paths to the index file, but only if the output files
* indicate that a direct file doesn't exist and an index file does.
*
* For example, it transforms:
* ```javascript
* import { myFunction } from '../folder';
* ```
* into:
* ```javascript
* import { myFunction } from '../folder/index';
* ```
*
* @returns {import('esbuild').Plugin} An ESBuild plugin object.
*/
export declare const fixFolderImportsPlugin: () => Plugin;
//# sourceMappingURL=fixFolderImportsPlugin.d.ts.map