diff --git a/.all-contributorsrc b/.all-contributorsrc
index a09169f..9cf668d 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -150,6 +150,15 @@
"contributions": [
"doc"
]
+ },
+ {
+ "login": "lPadier",
+ "name": "LoΓ―c Padier",
+ "avatar_url": "https://avatars2.githubusercontent.com/u/4009640?v=4",
+ "profile": "http://loicpadier.com",
+ "contributions": [
+ "code"
+ ]
}
]
}
diff --git a/README.md b/README.md
index 60feb5b..180bec5 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ Enables zero-config, importable babel plugins
[![downloads][downloads-badge]][npmchart]
[![MIT License][license-badge]][license]
-[![All Contributors](https://img.shields.io/badge/all_contributors-15-orange.svg?style=flat-square)](#contributors)
+[![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors)
[![PRs Welcome][prs-badge]][prs]
[![Donate][donate-badge]][donate]
[![Code of Conduct][coc-badge]][coc]
@@ -347,7 +347,7 @@ Thanks goes to these people ([emoji key][emojis]):
| [
Kent C. Dodds](https://kentcdodds.com)
[π»](https://github.com/kentcdodds/babel-plugin-macros/commits?author=kentcdodds "Code") [π](https://github.com/kentcdodds/babel-plugin-macros/commits?author=kentcdodds "Documentation") [π](#infra-kentcdodds "Infrastructure (Hosting, Build-Tools, etc)") [β οΈ](https://github.com/kentcdodds/babel-plugin-macros/commits?author=kentcdodds "Tests") | [
Sunil Pai](https://github.com/threepointone)
[π€](#ideas-threepointone "Ideas, Planning, & Feedback") | [
Stephen Scott](http://suchipi.com/)
[π¬](#question-suchipi "Answering Questions") [π](https://github.com/kentcdodds/babel-plugin-macros/commits?author=suchipi "Documentation") | [
Michiel Dral](http://twitter.com/dralletje)
[π€](#ideas-dralletje "Ideas, Planning, & Feedback") | [
Kye Hohenberger](https://github.com/tkh44)
[π€](#ideas-tkh44 "Ideas, Planning, & Feedback") | [
Mitchell Hamilton](https://hamil.town)
[π»](https://github.com/kentcdodds/babel-plugin-macros/commits?author=mitchellhamilton "Code") [β οΈ](https://github.com/kentcdodds/babel-plugin-macros/commits?author=mitchellhamilton "Tests") | [
Justin Hall](https://github.com/wKovacs64)
[π](https://github.com/kentcdodds/babel-plugin-macros/commits?author=wKovacs64 "Documentation") |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [
Brian Pedersen](https://github.com/PiereDome)
[π»](https://github.com/kentcdodds/babel-plugin-macros/commits?author=PiereDome "Code") [π](https://github.com/kentcdodds/babel-plugin-macros/commits?author=PiereDome "Documentation") | [
Andrew Palm](https://github.com/apalm)
[π»](https://github.com/kentcdodds/babel-plugin-macros/commits?author=apalm "Code") | [
Michael Hsu](https://michaelhsu.tw/)
[π](https://github.com/kentcdodds/babel-plugin-macros/commits?author=evenchange4 "Documentation") [π](#plugin-evenchange4 "Plugin/utility libraries") | [
Bo Lingen](https://github.com/citycide)
[π»](https://github.com/kentcdodds/babel-plugin-macros/commits?author=citycide "Code") | [
Tyler Haas](https://github.com/tylerthehaas)
[π](https://github.com/kentcdodds/babel-plugin-macros/commits?author=tylerthehaas "Documentation") | [
FWeinb](https://github.com/FWeinb)
[π»](https://github.com/kentcdodds/babel-plugin-macros/commits?author=FWeinb "Code") | [
TomΓ‘Ε‘ Ehrlich](http://www.tomasehrlich.cz)
[π](https://github.com/kentcdodds/babel-plugin-macros/issues?q=author%3Atricoder42 "Bug reports") [π»](https://github.com/kentcdodds/babel-plugin-macros/commits?author=tricoder42 "Code") |
-| [
Jonas Gierer](https://github.com/jgierer12)
[π](https://github.com/kentcdodds/babel-plugin-macros/commits?author=jgierer12 "Documentation") |
+| [
Jonas Gierer](https://github.com/jgierer12)
[π](https://github.com/kentcdodds/babel-plugin-macros/commits?author=jgierer12 "Documentation") | [
LoΓ―c Padier](http://loicpadier.com)
[π»](https://github.com/kentcdodds/babel-plugin-macros/commits?author=lPadier "Code") |
This project follows the [all-contributors][all-contributors] specification.
diff --git a/src/index.js b/src/index.js
index 684febb..78c3140 100644
--- a/src/index.js
+++ b/src/index.js
@@ -223,14 +223,20 @@ function getConfig(macro, filename, source) {
// FWIW, this thing told me that cosmiconfig is 227.1 kb of minified JS
// so that's probably significant... https://bundlephobia.com/result?p=cosmiconfig@3.1.0
// Note that cosmiconfig will cache the babel-plugin-macros config π
- const explorer = require('cosmiconfig')('babel-plugin-macros')
- const loaded = explorer.searchSync(filename, {
+ const explorer = require('cosmiconfig')('babel-plugin-macros', {
+ searchPlaces: [
+ 'package.json',
+ `.babel-plugin-macrosrc`,
+ `.babel-plugin-macrosrc.json`,
+ `.babel-plugin-macrosrc.yaml`,
+ `.babel-plugin-macrosrc.yml`,
+ `.babel-plugin-macrosrc.js`,
+ `babel-plugin-macros.config.js`,
+ ],
packageProp: 'babelMacros',
- rc: '.babel-plugin-macrosrc',
- js: 'babel-plugin-macros.config.js',
- rcExtensions: true,
sync: true,
})
+ const loaded = explorer.searchSync(filename)
if (loaded) {
return loaded.config[macro.options.configName]
}