Define deps & loaders in package.json

As a package developer it’d be freaking awesome to define deps in the package.json, so that a require("foo") loads it’s main as well as any additional stuff it may need.

{
  name: "foo",
  main: "src/foo.js", // for non-webpackers
  webpack: ["src/foo.js", "src/css/styles.css", "src/html/template.html"],
}

But a lot of the time the deps require a loader…

{
name: “foo”,
main: “src/foo.js”,
webpack: [“6to5!src/foo.js”, “styl!css!src/css/styles.styl”, “handlebars!src/html/template.hbs”],
}

Is there any way of making that work?

Author: Fantashit

1 thought on “Define deps & loaders in package.json

Comments are closed.