@floatable/babel-plugin-floatable
v0.1.2
Published
Babel plugin that annotates JSX elements with data-floatable-* metadata.
Readme
@floatable/babel-plugin-floatable
Babel plugin that annotates JSX elements with data-floatable-* metadata.
Install
npm install --save-dev @floatable/babel-plugin-floatableUsage
// babel.config.js
module.exports = {
plugins: [
[
"@floatable/babel-plugin-floatable",
{
rootDir: __dirname
// allowProduction: true,
}
]
]
};Output
The plugin adds these attributes to JSX elements:
data-floatable-path:relative/path.jsdata-floatable-line:linedata-floatable-column:column
Options
rootDir(string): base directory for relative paths. Defaults toprocess.cwd().allowProduction(boolean): opt in to run whenNODE_ENV=production.env(string): if set to"production", requires opt-in.
Release
npm run build
npm version <patch|minor|major>
npm publish --access publicNotes
- Existing attributes are preserved; the plugin only fills missing values.
