Skip to content

Instantly share code, notes, and snippets.

@wycats
Last active December 23, 2015 05:19
Show Gist options
  • Save wycats/dba8578fb748c2f4e132 to your computer and use it in GitHub Desktop.
Save wycats/dba8578fb748c2f4e132 to your computer and use it in GitHub Desktop.

Module Metadata for Bower Packages

Bower is a module-system and package-structure agnostic package manager. It focuses on making it easy to download packages, and leaves it to additional tools to handle the rest.

This document provides minimal additional metadata and structure that packages can opt into in order to make it possible for tools to automate the process of stitching together multiple packages into an application.

Module Type

Currently, there are four major module systems used in source files by browser JavaScript developers:

  • AMD
  • Node
  • ES6 Syntax
  • Globals

In order for tools to be able to automatically support interoperability between these source files, they need to know the type of modules used in the source files.

Package authors can add a new key in their bower.json manifest:

moduleType (optional) ["amd"|"node"|"es6"|"globals"|Array of these]

If a moduleType is used, the module MUST be written in a compatible subset of the module system, as defined by the companion spec Module Interoperability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment