I have a very specific need: I want to apply part of a SASS code from Project A into Project B. For that to happen, I need to bundle, in a single file, all variables and mixins which are referenced from a specific file.
Let's say the .scss portion of Project A that needs to be exported is called _header.scss. That file contains the exact chunk of code I need to apply and reuse in Project B.
Now, the challenge is that _header.scss uses several variables and mixins which are defined in global _variables.scss and _mixins.scss files. _header.scss doesn't use all the variables and mixins defined in the project, just a smaller set of them.
Therefore, I would like to run a gulp, yarn or node command to grab _header.scss, read the variables and mixins it relies on and compile an output file (_header-compiled.whatever.scss) that includes the mixins and variables it depends on, as well as the SASS code itself.
Which command shall I execute to run this check and output everything I need in Project B in a single file?
If you think there is an overall better solution for me to use than doing this type of compilation, please, feel free to suggest.
Many thanks in advance!