Skip to content

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

@mmktomato

Description

@mmktomato

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions