Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: support .web-ext-config.js in the current directory. #2812

Closed
uiolee opened this issue Jul 11, 2023 · 5 comments · Fixed by #2843
Closed

Feat: support .web-ext-config.js in the current directory. #2812

uiolee opened this issue Jul 11, 2023 · 5 comments · Fixed by #2843

Comments

@uiolee
Copy link
Contributor

uiolee commented Jul 11, 2023

Feat

Automatic discovery of configuration files

web-ext will load existing configuration files in the following order:

  • A config file named .web-ext-config.js in your home directory
  • ......
  • A config file named web-ext-config.js in the current directory.

about Automatic discovery of configuration files, I hope that support .web-ext-config.js in the current directory, instead of web-ext-config.js.

i dont undestand why the name of configuration files is different home dir and current dir. I don't think it's necessary

@Rob--W
Copy link
Member

Rob--W commented Jul 20, 2023

I don't understand the naming choice either; it was proposed in #730.

We can support another config file by adding it to https://github.com/mozilla/web-ext/blob/3ff64882d0e46c2952cbd661541981d68cc0a03f/src/config.js#L151C28-L158 , plus unit tests. For relevant files to touch, see the PR where the feature was originally introduced: #1161.

We should merge this change only at the next major version update, because the inclusion of a config file can potentially change the observed behavior. For example, a project could have a template .web-ext-config.js file with placeholders that someone should fill in.

@ioanarusiczki
Copy link

@willdurand Let me know if this requires qa and what to check.

@willdurand
Copy link
Member

willdurand commented Nov 30, 2023

@ioanarusiczki yes please. This is about making sure that we can use a config file named .web-ext-config.js (with the leading dot).

@ioanarusiczki
Copy link

ioanarusiczki commented Dec 7, 2023

@willdurand

Inside add-ons folder I've added .web-ext-config.js (in my case empty) started an upload
At the beginning of the upload I see the file is applied like .\.web-ext-config.js

I hope that's expected, a bit confusing because here mentions a slash being used (not backslash) later edit I found the explanation, I'm working on Windows and slashed are probably on Linux and MacOS

applying config file

@uiolee
Copy link
Contributor Author

uiolee commented Oct 30, 2024

the file is applied like .\.web-ext-config.js

@ioanarusiczki
path.join() will resolve the slash base on system, generally speaking we don't need to care about slashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants