babel-plugin-turbo-name
raw JSON → 2.1.1 verified Sat Apr 25 auth: no javascript
A Babel plugin that transforms code for the turbo-name system. Version 2.1.1 is the latest stable release. This package is a narrow-purpose Babel transform with no active development or known release cadence. It differs from general-purpose Babel plugins by focusing exclusively on name mangling for the turbo-name optimization framework. No alternative features or integrations are documented.
Common errors
error Error: Cannot find module 'babel-plugin-turbo-name' ↓
cause Missing local installation.
fix
npm install babel-plugin-turbo-name --save-dev
error TypeError: (0 , _turboName.default) is not a function ↓
cause Using require() on ESM-only module.
fix
Use import statement: import turboNamePlugin from 'babel-plugin-turbo-name'
Warnings
breaking ESM-only since v2; require() will fail. ↓
fix Use import syntax instead of require.
gotcha Default export only; named export 'babelPreset' removed in v2. ↓
fix Use default import for the plugin; for preset, import from subpath 'babel-plugin-turbo-name/preset'.
Install
npm install babel-plugin-turbo-name yarn add babel-plugin-turbo-name pnpm add babel-plugin-turbo-name Imports
- default wrong
const turboNamePlugin = require('babel-plugin-turbo-name')correctimport turboNamePlugin from 'babel-plugin-turbo-name' - babelPreset wrong
const babelPreset = require('babel-plugin-turbo-name').babelPresetcorrectimport { babelPreset } from 'babel-plugin-turbo-name/preset'
Quickstart
// babel.config.js
module.exports = {
plugins: [['babel-plugin-turbo-name', { turbo: 'name' }]]
};
// Example input
const x = 'hello';
// Output: mangled variable name