Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

broccoli-module-alchemist

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-module-alchemist

Broccoli-based tool for transforming ES2015 and TypeScript into many different module formats, for Node.js and the browser.

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Broccoli Module Alchemist

Build Status

A Broccoli plugin for transpiling TypeScript and JavaScript code written with standard module syntax ("ES6 modules") into legacy module formats, like UMD, AMD and CommonJS.

Usage

Broccoli Module Alchemist is a Broccoli plugin that can be used from your project's ember-cli-build.js or Brocfile.js.

Here's an example ember-cli-build.js file:

var alchemist = require('broccoli-module-alchemist');

module.exports = function() {
  return alchemist();
}

Authoring JavaScript and TypeScript

Place your package's source code in a root src directory. TypeScript files should have the extension .ts, while JavaScript files should have the extension .js.

Make sure to use the standard module syntax for importing dependencies and specifying exports.

Output

When your package is built (either by running ember build or broccoli build), the transpiled output will be placed into the dist directory.

In all cases, the source JavaScript or TypeScript is compiled to an ES5 target for maximum compatibility across browsers and Node.js versions. For example, the JavaScript module output contains ES6 module syntax but all other code is converted to ES5.

PathFormat
dist/jsJavaScript (ES6) modules, ES5 code
dist/cjsCommonJS
dist/umd/package-name.jsUMD (AMD if detected, global in browser, CommonJS in Node)

Distribution

npm

In your package.json:

  1. Add a main entry pointing to dist/cjs/index.js (or whatever your entry point is).
  2. Add a jsnext:main entry pointing to dist/js/index.js.

Bower

We do not recommend supporting Bower, but if you would like to for backwards-compatibility, consider creating a new repository on GitHub and publishing a bower.json there, along with whatever directories in dist you want to support (probably UMD).

Keywords

FAQs

Package last updated on 20 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc