[Feature] Extracted config files
See original GitHub issueTo preface this I would like to say that I’m not sure it fits in feature requests
, maybe it’s a compatibility
depending on how you see it.
- I’d be willing to implement this feature (contributing guide)
- This feature is important to have in this repository; a contrib plugin wouldn’t do
Describe the user story
My project use react-redux-typescript-scripts
which is a package that contains common configuration for react/redux/typescript projects.
In my tsconfig.json
I write the following :
{
...
"extends": "./node_modules/react-redux-typescript-scripts/tsconfig.json",
...
}
When moving to berry
I lost the node_modules
and the configuration file is not longer available.
In my case it’s a config file, but it can also be sass/css
files that need to be imported into a pre-processor, external to the project itself.
Describe the solution you’d like
Being able to tell yarn
to extract a particular file or package could be the simplest way to go. A .yarnrc.yml
could look like :
extractFiles:
- 'mypackagename:./path-to-file'
Clearly this would impact the cache directory and zer0 installs but right now this is only way to provide a compatibility.
Maybe this could belong in a plugin, I’m not sure of what plugins are capable of.
Describe the drawbacks of your solution
Will increase the size of committed cache, but the effect is negligible.
Describe alternatives you’ve considered
Why not make it a plugin? I have no idea, maybe plugins can do that. Not to rant but at some point if you want adoption you have to consider lowering the number of steps required for user to migrate.
The only alternative I see is to manually copy the file into my project root in order to be able to access it. Obviously this is an issue for package updates for exemple.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
tsconfig
files let you use the name of the dependency. (I.e.react-redux-typescript-scripts/tsconfig.json
)You can use
require.resolve
to get the location of any dependencyThat wouldn’t work - those files could themselves reference resources, which would then be resolve relative to the extracted file (which would be incorrect).
You can already do it with
unplugged