Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept Javascript config file #795

Open
wojciechczerniak opened this issue Apr 7, 2023 · 0 comments
Open

Accept Javascript config file #795

wojciechczerniak opened this issue Apr 7, 2023 · 0 comments

Comments

@wojciechczerniak
Copy link

wojciechczerniak commented Apr 7, 2023

Feature suggestion

CLI usage is quite limited in more advanced scenarios because args types can't accept functions. And moving those to config file does not help, as the only option we currently have is JSON file, which have the very same limitations. One of those limitations can be lifted if --config could accept JS module file, ie. like webpack.config.js or few other examples in the ecosystem.

const JSONConfigContent = fs.readFileSync(path.resolve(file));
const externalConfig = JSON.parse(JSONConfigContent);

Instead plain strings only, we could set functions and use external utilities, just like API config object can.

svg-sprite --config=svg-spirte.config.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants