Closed qortex closed 2 years ago
You're welcome to create a PR
Cool! Does the solution with argv look good to you?
Not experienced with node.js script, but will look up the good practices in that regard.
Can you show an example, please?
explorerSync.search()
would be replaced with explorerSync.search([directoryGivenInArgv])
when this directory is given:
yarn run svg-generator --configDirectory="libs/myapp/shared/icons"
That would make the config search start from this folder as documented here: https://github.com/davidtheclark/cosmiconfig#explorersearch
As opposed to now where the config has to be at the root of the whole workspace (in a config file or in package.json).
LGTM
I'm submitting a...
Current behavior
Right now, a single config can be used because of this line: https://github.com/ngneat/svg-icon/blob/0c08b506f32c342a8c0f10e3ba01025892a3ec8a/svg-generator/index.ts#L7
A single config can be specified (unless I don't know how to do it?)
What is the motivation / use case for changing the behavior?
In a Nx monorepo setting with multiple apps that use different svg assets, I'd like to be able to launch
svg-generator
with multiple configs.Specifying the directory where the config lookup should start with
cosmiconfig
would be enough for me to setup various Nx executors with their own configs.Maybe a command line argument would do the trick?