{"id":20652,"library":"vinyl-tf-babel","title":"vinyl-tf-babel","description":"A Vinyl Transformer for Babel that integrates Babel compilation into vinyl-fs pipelines or Gulp. Version 0.1.0 is the latest stable release. It requires babel-core as a peer dependency and supports both ES modules and CommonJS. Differentiators include a class-based transformer (`BabelTransformer`) and a convenience function (`transform`) for Gulp, aligning with vinyl transformer standards.","status":"active","version":"0.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/stefanr/node-vinyl-tf-babel","tags":["javascript","vinyl","transformer","babel"],"install":[{"cmd":"npm install vinyl-tf-babel","lang":"bash","label":"npm"},{"cmd":"yarn add vinyl-tf-babel","lang":"bash","label":"yarn"},{"cmd":"pnpm add vinyl-tf-babel","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, not included; must be installed separately for Babel compilation","package":"babel-core","optional":false}],"imports":[{"note":"Supports both ESM and CJS; named export.","wrong":"const BabelTransformer = require('vinyl-tf-babel').BabelTransformer","symbol":"BabelTransformer","correct":"import { BabelTransformer } from 'vinyl-tf-babel'"},{"note":"Named export, often used as a Gulp plugin function.","wrong":"const transform = require('vinyl-tf-babel').transform","symbol":"transform","correct":"import { transform } from 'vinyl-tf-babel'"},{"note":"Default export is the transform function (an alias for `transform`); is the same as `import { transform as babel }`.","wrong":"const vinylTfBabel = require('vinyl-tf-babel')","symbol":"default import","correct":"import vinylTfBabel from 'vinyl-tf-babel'"}],"quickstart":{"code":"import gulp from 'gulp';\nimport { transform as babel } from 'vinyl-tf-babel';\n\ngulp.task('babel', () => {\n  return gulp.src('src/**/*.js')\n    .pipe(babel({ presets: ['@babel/preset-env'] }))\n    .pipe(gulp.dest('dist'));\n});","lang":"javascript","description":"Shows using the transform function with Gulp to compile JavaScript with Babel presets."},"warnings":[{"fix":"Install babel-core as a dependency: npm install babel-core","message":"babel-core must be installed separately; calling without it will throw 'Cannot find module babel-core'.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use vinyl-tf-babel with babel-core 6.x or switch to a transformer like gulp-babel.","message":"babel-core is deprecated in favor of @babel/core. This transformer may not work with @babel/core directly.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Consult Babel options documentation and validate configuration.","message":"Options passed to BabelTransformer or transform are forwarded directly to Babel; invalid options may cause silent failures.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Ensure the stream provides Vinyl file objects (e.g., from gulp.src or vinyl-fs src).","message":"This package is a Vinyl Transformer; it expects Vinyl objects in the stream. Using with non-Vinyl streams may cause errors.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install babel-core","cause":"babel-core is not installed: it's a peer dependency not bundled with vinyl-tf-babel.","error":"Error: Cannot find module 'babel-core'"},{"fix":"Use `new BabelTransformer()` or `transform()` accordingly.","cause":"Using default import incorrectly or forgetting to call new BabelTransformer.","error":"TypeError: transformer is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}