Registry / serialization / es6-module-transpiler-dist-formatter

es6-module-transpiler-dist-formatter

JSON →
library0.0.2jsnpmunverified

An extension for es6-module-transpiler that outputs modules in a dist bundle format compatible with Node.js, YModules, and global variables. Version 0.0.2 is the latest stable release. This package is no longer actively maintained and has been superseded by modern bundlers like Rollup or Webpack. Key differentiator: produces legacy wrappers for multiple module systems (CommonJS, YModules, global).

npm install es6-module-transpiler-dist-formatter
INSTALL
IMPORT
SIG · ES6-MODULE-TRANSPI
E
es6-module-transpiler-dist-formatter
serializationjavascriptv0.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import DistFormatter from 'es6-module-transpiler-dist-formatter'
const DistFormatter = require('es6-module-transpiler-dist-formatter')
ES module vs CommonJS; package is CJS only.
default
var DistFormatter = require('es6-module-transpiler-dist-formatter')
var {DistFormatter} = require('es6-module-transpiler-dist-formatter')
Only default export is provided; named destructuring will not work.

Shows how to create a transpiler container with the DistFormatter and output a bundle.

var transpiler = require('es6-module-transpiler'); var DistFormatter = require('es6-module-transpiler-dist-formatter'); var Container = transpiler.Container; var FileResolver = transpiler.FileResolver; var container = new Container({ resolvers: [new FileResolver(['lib/'])], formatter: new DistFormatter({ name: 'my-module' }) }); container.getModule('index'); container.write('dist/mylib.js'); console.log('Output written to dist/mylib.js');
Debug
Known issues
gotchaThe DistFormatter requires a module name option, otherwise output may be incorrect.
fix
Always pass { name: 'your-module-name' } to the constructor.
affects: >=0.0.0
deprecatedes6-module-transpiler and its formatters are deprecated in favor of modern tools like Rollup.
fix
Migrate to Rollup or Webpack with proper ES module output.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'es6-module-transpiler-dist-formatter'
Missing npm install of the package or incorrect require path.
fix
npm install es6-module-transpiler-dist-formatter --save-dev and ensure require path is correct.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
es6-module-transpilerrequiredPeer dependency; this package is a formatter for the transpiler
Agent activity
2 hits · last 30 days
node
2
Resources
es6-module-transpiler-dist-formatter — npm install es6-module-transpiler-dist-formatter · libregistry