Support configuration inheritance#164
Support configuration inheritance#164kwonoj wants to merge 3 commits intoelectron-userland:masterfrom kwonoj:feat-config-inheritance
Conversation
|
@kwonoj Does Babel support this syntax? I tried to keep the "env => whatever" syntax compatible |
|
@paulcbetts as noted above, {
"env": {
"production": {
...
},
"development": {
...
}
}
}will be consumed to pick up prod/dev per env. Only if anyone compose babelrc with those schema will make able to work with inheritance, but I highly doubt it since babel itself does not support it so no one will write it. These test case (https://github.com/electron/electron-compile/pull/164/files#diff-c978b3e1b35e3f56f197ecdec83270c6R253) are testing config values with current config values (without common). |
|
If intent is make |
|
fyi: babel/babel#4924 there are discussion, but not concluded. |
|
@kwonoj Nah, I think we'll probably take this, I'll have a look tomorrow. Since it doesn't technically make us non-compliant with Babel (i.e. all existing .compilerc files are still good), it'll probably be okay |
This PR updates configuration parser supports 'inheritance', allow only specify env-specific config value as needed.
.compilercnow can contain common config values as well asenvfield as well like below exampleand per environment configuration, it'll inherit default common values and override to env-specific value if it's specified.
Theoretically, this'll work not only for
.compilrcbut also for.babelrc- however default schema forbabelrcdoesn't allow those type of configuration and it falls back todevenv if env is not set, so I don't think this'll be common practice for users use their own babel configuration instead of.compilercthough.