Skip to content

Build tool extensions #23

@josh

Description

@josh

Basically, an alternative and more extensible format to the "moduleType" property proposed in #10.

{ "name": "jquery",
  "main": "jquery.js",
  "amd": {
    "main": "jquery-amd.js"
  },
  "es6-module": {
    "main": "jquery-es6.js"
  },
  "imports": {
    "main": ["jquery.html", "jquery.js", "jquery.css"]
  }
}

Instead of simply just declaring a moduleType, packages can declare a nested set of overrides. If the build tool is intended for AMD, it will prefer an amd.main value, otherwise fallback to the top level main.

Right now main is the only interesting property to build tools. Others could be introduced in the future and this format would support them.

I feel like the spec should list out a set of suggested "extension types" based on the use cases we've already seen.

  • amd
  • cjs or commonjs (probably the latter)
  • es6-modules
  • imports HTML import / web component style

/cc @robdodson @rpflorence @joliss @briandipalma @wibblymat @paulirish @benschwarz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions