Provide ability to overwrite feature flags in esm-bundler builds

feat: provide ability to overwrite feature flags in esm-bundler builds
Provide ability to overwrite feature flags in esm-bundler buildsfeatprovide ability overwrite feature flags esm

Committed by yyx990803

commit message
feat: provide ability to overwrite feature flags in esm-bundler builds

e.g. by replacing `__VUE_OPTIONS_API__` to `false` using webpack's
`DefinePlugin`, the final bundle will drop all code supporting the
options API.
 
This does not break existing usage, but requires the user to explicitly
configure the feature flags via bundlers to properly tree-shake the
disabled branches. As a result, users will see a console warning if
the flags have not been properly configured.

Editor assessment

The subject `feat: provide ability to overwrite feature flags in esm-bundler builds` states the new capability, and the body explains the motivating mechanism (replacing `__VUE_OPTIONS_API__` via webpack `DefinePlugin` to tree-shake the options API), the trade-off (users must configure the flags explicitly), and the resulting console warning — a model of explaining why and what the caller must do. No scope is given, acceptable for a cross-cutting build feature, and no breaking signal is needed since the body explicitly notes existing usage is unaffected. Style is clean and imperative, making this an exemplar.

Browse categories

More feat examples · Back to search