ethical-composer-middleware-babel

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

A Babel transpiler middleware for the Ethical framework's composer, enabling file transformation as part of a build pipeline. Version 0.0.0 is pre-release, with no stable releases yet. It integrates with the ethical-composer ecosystem to provide Babel transpilation middleware. Differentiators: part of a larger framework with a moral obligation to simplicity and scalability; designed for use with ethical-composer-emitter-watcher and other middlewares. Currently in early development with no published API stability.

error Cannot find module 'ethical-utility-babel-directory-transpiler'
cause Missing transitive dependency; must be installed separately.
fix
npm install ethical-utility-babel-directory-transpiler
error TypeError: babelMiddleware is not a function
cause Incorrect import style (CommonJS required?).
fix
Use ESM import: import babelMiddleware from 'ethical-composer-middleware-babel'
error Error: Babel presets not found
cause Required Babel presets not installed.
fix
npm install @babel/preset-env --save-dev
deprecated This package is part of the Ethical framework which is no longer actively maintained.
fix Consider using modern alternatives like Webpack or Babel standalone.
breaking Package is pre-release (v0.0.0) and has no stable API. Breaking changes may occur at any time.
fix Lock to specific commit or avoid using in production.
gotcha Expects an 'ethical-composer' instance; not a standalone Babel plugin.
fix Ensure you compose it with ethical-composer, not used directly.
gotcha Dependencies may require additional Babel presets/plugins to be installed manually.
fix Install required Babel presets/plugins explicitly in your project.
npm install ethical-composer-middleware-babel
yarn add ethical-composer-middleware-babel
pnpm add ethical-composer-middleware-babel

Sets up a composer pipeline with Babel middleware to transpile files from /src to /dist.

import babelMiddleware from 'ethical-composer-middleware-babel';
import { compose } from 'ethical-composer';

const composer = compose(
  babelMiddleware({
    babelOptions: {
      presets: ['@babel/preset-env']
    }
  })
);

composer.process('/src', '/dist').then(() => {
  console.log('Transpilation complete');
});