esm - remove build support for `prepend`

pull/229915/head
Benjamin Pasero 2024-09-27 08:05:22 +02:00
parent 87f3486f5f
commit 7d428d77a0
No known key found for this signature in database
GPG Key ID: E6380CC4C8219E65
3 changed files with 1 additions and 17 deletions

View File

@ -51,6 +51,7 @@ export interface IEntryPoint {
name: string;
include?: string[];
exclude?: string[];
/** @deprecated unsupported by ESM */
prepend?: IExtraFile[];
dest?: string;
}

View File

@ -64,14 +64,6 @@ function optimizeESMTask(opts) {
});
}
};
// support for 'preprend' via the esbuild#banner
if (entryPoint.prepend?.length) {
for (const item of entryPoint.prepend) {
const fullpath = path.join(REPO_ROOT_PATH, opts.src, item.path);
const source = await fs.promises.readFile(fullpath, 'utf8');
banner.js += source + '\n';
}
}
const task = esbuild.build({
bundle: true,
external: entryPoint.exclude,

View File

@ -96,15 +96,6 @@ function optimizeESMTask(opts: IOptimizeESMTaskOpts): NodeJS.ReadWriteStream {
}
};
// support for 'preprend' via the esbuild#banner
if (entryPoint.prepend?.length) {
for (const item of entryPoint.prepend) {
const fullpath = path.join(REPO_ROOT_PATH, opts.src, item.path);
const source = await fs.promises.readFile(fullpath, 'utf8');
banner.js += source + '\n';
}
}
const task = esbuild.build({
bundle: true,
external: entryPoint.exclude,