atom-babel6-transpiler

raw JSON →
1.2.0 verified Fri May 01 auth: no javascript deprecated

Atom package transpiler that processes files with Babel 6. Version 1.2.0 is the latest. Designed for use within Atom's package transpiler system. Provides integration with Babel 6, including support for .babelrc configuration, presets, and plugins. Features include automatic BABEL_ENV setting for development/production, configurable cache key files, and inline source maps. Key differentiator: official Atom package transpiler for Babel 6, part of the Atom ecosystem for package development.

error Error: Cannot find module 'babel-core'
cause Babel 6 not installed as a dependency.
fix
Run: npm install --save babel-core
error Error: Could not find preset 'es2015' relative to directory
cause Babel preset not installed or not configured correctly.
fix
Install preset: npm install --save babel-preset-es2015 and add to options.
deprecated Atom's package transpiler system is deprecated; use Babel directly or another build tool.
fix Migrate to using Babel standalone or a build system like webpack or gulp.
gotcha If babelrc is not set to false, Babel may use user's .babelrc from filesystem leading to unexpected behavior.
fix Set "babelrc": false in options.babel.
breaking Atom's transpiler architecture changed after this package was released; may not work with newer Atom versions.
fix Check Atom version compatibility; consider alternative transpilation.
npm install atom-babel6-transpiler
yarn add atom-babel6-transpiler
pnpm add atom-babel6-transpiler

Installs the transpiler, configures package.json, installs Babel presets, and sets up Babel options.

npm install --save atom-babel6-transpiler
# Then in package.json add:
{
  "atomTranspilers": [
    {
      "glob": "**/*.js",
      "transpiler": "atom-babel6-transpiler",
      "options": {
        "babel": {
          "presets": ["es2015", "react"],
          "babelrc": false
        },
        "setBabelEnv": true
      }
    }
  ]
}
# Then install Babel presets:
npm install --save babel-preset-es2015 babel-preset-react
# Create .babelrc or use options.babel above