A Babel plugin that injects source code location info (file path, line, column) into JSX element attributes for development use. Version 1.0.6, minimal configuration, adds custom data attributes like trae-inspector-file-path. Lightweight alternative to similar dev tools, focused on integration with Trae IDE or custom inspectors. Ships TypeScript types, requires Node >=12.
npm install babel-plugin-react-dev-locatorVerified import paths — ran on the pinned version, not inferred.
Shows how to install and configure the plugin, then demonstrates JSX transformation with source location attributes.
Upgrade Babel to 7.x and Node to >=12.
Check plugin options to customize attribute prefixes (none currently documented).
Use environment-based Babel config: plugins: process.env.NODE_ENV !== 'production' ? ['babel-plugin-react-dev-locator'] : []
Consider alternatives like babel-plugin-jsx-source or custom Babel plugin.
Run 'npm install -D babel-plugin-react-dev-locator' or 'yarn add -D babel-plugin-react-dev-locator'.
Use string plugin name in Babel config: plugins: ['babel-plugin-react-dev-locator'] instead of require().
Add '@babel/preset-react' to your Babel presets.
No dependency data recorded yet.