es6-module-transpiler YUI Formatter

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

A plugin formatter for es6-module-transpiler that compiles ES6 module syntax into YUI.add() format. Version 0.3.0 is the latest stable release. This formatter allows developers to write ES6 modules and transpile them for use in YUI applications. It is maintained as part of the es6-module-transpiler ecosystem and sacrifices some ES6 features (like live bindings) to work with YUI's mutable namespace. Designed for build tool integration via CLI or programmatic API. Deprecated in favor of modern bundlers; no updates since 2015.

error Error: Cannot find module 'es6-module-transpiler-yui-formatter'
cause The package is not installed or is installed globally but not locally.
fix
Run 'npm install es6-module-transpiler-yui-formatter --save-dev' in your project directory.
error TypeError: YUIFormatter is not a constructor
cause The require returns the module, but the formatter is the module itself, not a property.
fix
Use: var YUIFormatter = require('es6-module-transpiler-yui-formatter');
error SyntaxError: Unexpected token export
cause The code uses ES6 module syntax but the transpiler/formatter is not set up correctly.
fix
Ensure es6-module-transpiler is installed and configured with the YUI formatter.
deprecated This package is deprecated. It has not been updated since 2015 and relies on an abandoned transpiler. Modern projects should use Babel or TypeScript.
fix Migrate to a modern module transpiler like Babel or TypeScript and output UMD or ES modules.
breaking Live bindings are not supported. ES6 module live bindings are compiled to static exports, which may lead to unexpected behavior with exported values that are reassigned after import.
fix Avoid relying on live bindings. Re-export values explicitly if needed.
gotcha Requires es6-module-transpiler version 0.10.x to work. Using newer or older versions may cause compatibility issues.
fix Ensure es6-module-transpiler is pinned to 0.10.x in package.json.
deprecated The CLI tool 'compile-modules' is no longer maintained and may not install correctly.
fix Use programmatic API or switch to a different build tool.
gotcha Default exports are compiled into a single __es6_export__ call, but the original function is not hoisted. This may cause ordering issues if the default export function is referenced before the YUI.add() callback.
fix Ensure imports of default exports occur after the module is loaded or use named exports instead.
npm install es6-module-transpiler-yui-formatter
yarn add es6-module-transpiler-yui-formatter
pnpm add es6-module-transpiler-yui-formatter

Demonstrates programmatic usage of the YUI formatter with es6-module-transpiler: create container, set resolver and formatter, compile module, write output.

var transpiler = require('es6-module-transpiler');
var YUIFormatter = require('es6-module-transpiler-yui-formatter');
var Container = transpiler.Container;
var FileResolver = transpiler.FileResolver;

var container = new Container({
  resolvers: [new FileResolver(['lib/'])],
  formatter: new YUIFormatter()
});

container.getModule('index');
container.write('out/mylib.js');