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
45 lines • 1.89 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export(src_exports, {
fixAliasPlugin: () => import_fixAliasPlugin.fixAliasPlugin,
fixExtensionsPlugin: () => import_fixExtensionsPlugin.fixExtensionsPlugin,
fixFolderImportsPlugin: () => import_fixFolderImportsPlugin.fixFolderImportsPlugin,
fixImportsPlugin: () => fixImportsPlugin
});
module.exports = __toCommonJS(src_exports);
var import_fixAliasPlugin = require('./fixAliasPlugin.cjs');
var import_fixExtensionsPlugin = require('./fixExtensionsPlugin.cjs');
var import_fixFolderImportsPlugin = require('./fixFolderImportsPlugin.cjs');
const fixImportsPlugin = () => ({
name: "fixImportsPlugin",
setup: (build) => {
(0, import_fixAliasPlugin.fixAliasPlugin)().setup(build);
(0, import_fixFolderImportsPlugin.fixFolderImportsPlugin)().setup(build);
(0, import_fixExtensionsPlugin.fixExtensionsPlugin)().setup(build);
}
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
fixAliasPlugin,
fixExtensionsPlugin,
fixFolderImportsPlugin,
fixImportsPlugin
});
//# sourceMappingURL=index.cjs.map