{"library":"babel-plugin-const-enum","type":"library","category":null,"description":"babel-plugin-const-enum is a Babel plugin designed to transform TypeScript `const enum` declarations. Babel's standard TypeScript presets/plugins (`@babel/preset-typescript` or `@babel/plugin-transform-typescript`) do not inherently handle `const enum`s, which are erased during TypeScript's compilation if not explicitly preserved or transformed. This plugin, currently at version 1.2.0, provides a solution by enabling two transformation strategies: `removeConst` (the default, converting `const enum`s into regular `enum`s) or `constObject` (transforming them into constant object literals). The `constObject` strategy is particularly useful for environments where minifiers like Terser or UglifyJS can then effectively inline these values, leading to smaller bundle sizes. It acts as a critical intermediary step for projects using TypeScript with Babel that rely on `const enum`s, ensuring their correct processing and optimization. The release cadence is driven by community needs and Babel ecosystem changes.","language":"javascript","status":"active","version":"1.2.0","tags":["javascript","babel-plugin","typescript","const","enum","terser","uglify","minify","compress"],"last_verified":"Wed May 27","install":[{"cmd":"npm install babel-plugin-const-enum","imports":["{ \"plugins\": [\"const-enum\"] }","{ \"plugins\": [[\"const-enum\", {\"transform\": \"constObject\"}]] }","require('babel-plugin-const-enum')"]},{"cmd":"yarn add babel-plugin-const-enum","imports":[]},{"cmd":"pnpm add babel-plugin-const-enum","imports":[]}],"homepage":null,"github":"https://github.com/dosentmatter/babel-plugin-const-enum","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/babel-plugin-const-enum","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/babel-plugin-const-enum/compatibility"}}