lerna has this neat feature for dynamically creating the commit message. They use placeholders in a string and replace them with the version number. For example:
lerna version -m "chore(release): publish %v"
# commit message = "chore(release): publish 1.0.0"
What if we did something similar to allow users to dynamically create the output file. This would enabled most users to use the feature directly from the command line. It would also negate the need for additional props like fileExt.
node-sass-extra src/**/*.scss -o dist/%n.min.css
dist/
my-file.min.css
my-other-file.min.css
We could possibly use Path's Path Object as the variables to replace.
So, in the case of:
/src/path/to/my-file.scss
These could be the options:
%d (dir) -> src/path/to
%r (root) -> /
%b (base) -> my-file.scss
%n (name) -> my-file
%e (ext) -> .scss
We could also just make up our own, I mean how useful would ext or base be when the file extensions is always going to be .css instead of .scss?
This feature would also enable the preservation of the file tree (since we may default the behavior to flattening the files)
node-sass-extra src/**/*.scss -o dist/%d/%b.css
Would this be passed via the output prop, or somewhere else/new API?
lerna has this neat feature for dynamically creating the commit message. They use placeholders in a string and replace them with the version number. For example:
What if we did something similar to allow users to dynamically create the output file. This would enabled most users to use the feature directly from the command line. It would also negate the need for additional props like
fileExt.We could possibly use Path's Path Object as the variables to replace.
So, in the case of:
These could be the options:
We could also just make up our own, I mean how useful would
extorbasebe when the file extensions is always going to be.cssinstead of.scss?This feature would also enable the preservation of the file tree (since we may default the behavior to flattening the files)
Would this be passed via the
outputprop, or somewhere else/new API?