esbuild icon indicating copy to clipboard operation
esbuild copied to clipboard

Feature request: `--drop` for labels

Open pushkine opened this issue 3 years ago • 0 comments

Feature request:

Option to define ids of LabelStatements to be stripped from the output

e.g. --droplabel:__DEV__

I find labels to be a better solution over build-time variable injection Rollup has a plugin called "@rollup/plugin-strip" for this purpose:

plugins: [
    // strips all `__DEV__: ...` labels
    strip({ labels: ["__DEV__"], include: "**/*.ts" }),
]

Might be a niche request but this is actually the only rollup feature I ever use beside transpilers, I'd love to have that option on esbuild

pushkine avatar Jul 19 '22 09:07 pushkine