Babel plugin (v6.22.0) that transforms function declarations inside blocks to be block-scoped, ensuring compatibility with ES2015 semantics in older environments. This plugin is part of Babel's deprecated 'es2015' preset and is no longer maintained independently. It converts block-level function declarations to variable assignments with the same name, preventing hoisting issues. For modern Babel usage (v7+), use @babel/plugin-transform-block-scoped-functions instead.
npm install babel-plugin-transform-es2015-block-scoped-functionsVerified import paths — ran on the pinned version, not inferred.
Shows how to configure and use the plugin to block-scope function declarations within blocks.
Replace with @babel/plugin-transform-block-scoped-functions in Babel v7 projects.
Use @babel/plugin-transform-block-scoped-functions or include in @babel/preset-env (which automatically includes it when needed).
Upgrade to @babel/core v7 and use @babel/plugin-transform-block-scoped-functions.
No fix needed; understand the scope of the plugin.
npm install babel-plugin-transform-es2015-block-scoped-functions --save-dev (for Babel 6) or use @babel/plugin-transform-block-scoped-functions (for Babel 7+)
Switch to @babel/plugin-transform-block-scoped-functions.
Ensure plugin name is correct and in quotes: "transform-es2015-block-scoped-functions"