mozilla / web-ext

A command line tool to help build, run, and test web extensions
Mozilla Public License 2.0
2.7k stars 338 forks source link

[Feature Request] Discover config files in Node.js code #1841

Open mmktomato opened 4 years ago

mmktomato commented 4 years ago

Is this a feature request or a bug?

A feature request.

What is the current behavior?

Below code doesn't read web-ext-config.js or webExt in package.json.

import webExt from 'web-ext';

webExt.cmd.run({
  sourceDir: '/path/to/source/',
});

What is the expected or desired behavior?

I wanted webExt.cmd.run to discover default config files. I read web-ext's code and I guess current behavior is intentional. So my suggestion is: adding an option like loadConfigFiles or configPath to webExt.cmd.run's second argument. E.g.

webExt.cmd.run({
  sourceDir: '/path/to/source/'
}, {
  loadConfigFiles: true
  // or
  // configPath: '/path/to/config'
});

I think this option would be useful for bundler plugins. Actually I'm writing my Parcel plugin. Since Parcel is "zero configuration", I'm considering some ways how I pass configuration to web-ext.

ShivamAryaJha commented 4 years ago

Hi mmktomato! Sorry, this isn't related to the issue but there's no way to direct message on GitHub. I'm a complete rookie in world of open source. I really wish to contribute Could you please help me through some beginner-level doubts? You could share your emailID, or any other way to communicate with u.

2zqa commented 8 months ago

Can reproduce in 7.11.0. Hope this gets added!