ES6 Module Transpiler Closure Transformer

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

An experimental transformer for the es6-module-transpiler that converts ES6 modules into Closure Library-style modules with goog.require and goog.provide statements, preserving bundle order without concatenation. Version 1.0.0 is the only published release. Unlike the bundle transformer, this enables full Closure Compiler type checking (e.g., @private annotations) by keeping modules as separate files. The order is maintained identically to the bundle transformer to avoid inconsistencies. It requires Node.js and the es6-module-transpiler CLI.

error Error: Cannot find module 'es6-module-transpiler-closure'
cause The package is not installed or the path is incorrect.
fix
Run 'npm install es6-module-transpiler-closure --save' in your project directory.
gotcha This package is experimental and only at version 1.0.0. It may have bugs and is not recommended for production use.
fix Consider using the bundle transformer or a more modern transpiler like Babel with Closure Compiler integration.
npm install es6-module-transpiler-closure
yarn add es6-module-transpiler-closure
pnpm add es6-module-transpiler-closure

Install the transpiler and this transformer, then use the CLI to convert an ES6 module to separate Closure-style files.

npm install es6-module-transpiler es6-module-transpiler-closure --save
compile-modules convert -f es6-module-transpiler-closure main.js -o dst