Babel plugin (v0.0.2, stable) that adds a `__namedExportsOrder` array to JavaScript files preserving the original order of named exports. Bundlers like Webpack 5 do not guarantee export order, but tools like Storybook rely on it for features such as story ordering. This plugin inserts a constant array listing export names in declaration order, enabling consumers to reconstruct the intended sequence. Lightweight and zero-config, but only works with static named exports (not dynamic or re-exports).
npm install babel-plugin-named-exports-orderVerified import paths — ran on the pinned version, not inferred.
Shows basic Babel configuration and the transform effect on a file with three named exports.
Ensure all exports to be ordered are static named exports declared directly in the file.
Avoid naming any export `__namedExportsOrder` in files processed by this plugin.
Use the __namedExportsOrder array in consuming code (e.g., Storybook) to reorder imports as needed.
Run `npm install --save-dev babel-plugin-named-exports-order` or `yarn add -D babel-plugin-named-exports-order`.
Verify .babelrc includes the plugin and that the file has at least one static named export declaration.