-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Open Question
See this wiki page for an explanation.
Background Details
I'm contributing to a project that's using package.json to install a heap of build-time dependencies, using the devDependencies section (i.e. it doesn't need to be published on npm).
What I want to do is effectively add a separate, optional build configuration that will build for a different target. This new build config would need an additional set of npm dependencies, but I don't want to add them to devDependencies as they wouldn't be needed by the majority of the people on the project.
I looked into the optionalDependencies option for package.json, but that doesn't do what I want. It will always try to install them, but not chuck a wobbly if they fail. Whereas I want a separate group of dependencies which are all required for the group, but to make the group itself an optional install.
Options
These are my current options as I see them:
- Add the extra dependencies to
devDependenciesoroptionalDependenciesand be done with it. If people don't like the extra bloat, too bad. - Make the extra build config effectively a "sub-package" by putting a separate
package.jsonin a subdirectory. This feels dirty. - Use something like squirrel and write some glue code.
- Throw my hands in the air, say "ah fuck it, I dunno, I'll ask someone else" and post an open question on GitHub.
I went with option 4, but doesn't help in the long term. Thoughts?
(cc @DamonOehlman who I know will be interested)