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

File Output and Mapper Function #30

Open
bevanjkay opened this issue Jun 1, 2021 · 2 comments
Open

File Output and Mapper Function #30

bevanjkay opened this issue Jun 1, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@bevanjkay
Copy link

Describe the solution you'd like
It would be cool if you could include a mapping function as a part of the config file.
So that, when the request is completed, the data is passed through the function before being output to the file.

I would also like to be able to utilise fs-extra's outputFile function, as I am outputting to a .scss file.

Describe alternatives you've considered
I have modified the module.js in my local install with a hard-coded mapper function to do what I need to.
I may look at implementation also and submit a PR depending on where you are at with the project.

Additional context
I am using the module to pull some data from a CMS API (sanity) and pass some colors and other variables as Global SCSS variables that in then injected throughout the Nuxt app. I haven't considered performance of these changes, as I am generating for static.

@bevanjkay
Copy link
Author

Just thinking about this workflow a bit further and how it would integrate with the app. I have it working in my environment to be able to pass a 'type' to the file for json or static output, and also to pass a mapper function.

Just thinking that there could be a use case to output data to more than one file?
So perhaps allowing the file property to be an array could be also be beneficial.

@LuXDAmore LuXDAmore self-assigned this Jun 3, 2021
@LuXDAmore LuXDAmore added the enhancement New feature or request label Jun 3, 2021
@LuXDAmore
Copy link
Owner

Hi @bevanjkay 😄

Thank You for your advices!

I was already thinking about something similar due to the fact that i need it in one of my project XD

I think I'll try to add these enhancements as soon as I'm free! In this moment I'm a little bit busy!

If You want you can try to help my with a PR with these new features!

Have a nice day! 😸

@LuXDAmore LuXDAmore added help wanted Extra attention is needed good first issue Good for newcomers labels May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants