Browserslist: Add ability to extend file config

Created on 28 Aug 2019  路  5Comments  路  Source: browserslist/browserslist

I have project setup with Lerna and Yarn Workspaces:

packages/a/package.json
packages/a/.browserslistrc
packages/a/...
packages/b/package.json
packages/b/.browserslistrc
packages/b/...
package.json
.browserslistrc

In the root .browserslistrc file I have browsers list and in each package .browserslistrc file I would like to do

extends ../../.browserslistrc

but I can't. I can only extend from package like here:

extends @org/browserslist-config-mycompany

However, I don't want to create separate package to only define list of browsers

Most helpful comment

I opened an issue here to add json js and ts support for config files. That would solve the extension problem automatically as described in this article.

All 5 comments

Browserslist can鈥檛 to it right now because of security concerns.

What is the purpose for packages/a/.browserslistrc? Does it extends .browserslistrc from the root?

Hmm security concerns? Isn't it just something similar to other tools that allow extending config files?

Yep the one in packages/a extends the one in the root

Isn't it just something similar to other tools that allow extending config files?

I am not sure that other tools are secure ;)

Yep the one in packages/a extends the one in the root

You can create packages/our-browserslist-config, add it to workspaces and then use as extend our-browserslist-config. Will it work for you?

I think I've tried it already and it didn't work but I will try again and let you know

I opened an issue here to add json js and ts support for config files. That would solve the extension problem automatically as described in this article.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bdukes picture bdukes  路  9Comments

hudochenkov picture hudochenkov  路  10Comments

artoodeeto picture artoodeeto  路  7Comments

galvarez421 picture galvarez421  路  10Comments

deepkolos picture deepkolos  路  3Comments