Skip to content

Commit 7531dce

Browse files
Add dropLabels to BundleTaskParameters to strip out labelled statements (#65)
* Strip out dev if production build is specified * Clean up unused import * Change files * Prettier * Update based on feedback * Update cl
1 parent 17dd6b0 commit 7531dce

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "Bundle tasks parameters can now take in dropLabels to strip out certain labelled statements.",
4+
"packageName": "@minecraft/core-build-tasks",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

tools/core-build-tasks/src/tasks/bundle.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ export type BundleTaskParameters = {
2626

2727
/** The output path for the source map file. Ignored if sourcemap is false or 'inline'. */
2828
outputSourcemapPath?: string;
29+
30+
/** Strip out statements with these labels. Documentation: https://esbuild.github.io/api/#drop-labels */
31+
dropLabels?: string[];
2932
};
3033

3134
export type PostProcessOutputFilesResult = {
@@ -115,6 +118,7 @@ export function bundleTask(options: BundleTaskParameters): ReturnType<typeof par
115118
sourcemap: isRequiredToLinkJs ? 'external' : options.sourcemap,
116119
external: options.external,
117120
write: !isRequiredToMakeChanges,
121+
dropLabels: options.dropLabels,
118122
});
119123

120124
if (buildResult.errors.length === 0) {

0 commit comments

Comments
 (0)