I am using the uglifycss npm package to minify all the CSS files from the project output directory. I am executing the following post-build script to minify the CSS files content and rename the files by appending *.min.css
find dist/assets/css/ -type f -name "*.css" -exec uglifycss --output {}.min.css {} \; -exec rm {} \;
Files before executing the script:
Files after executing the script:
I want to remove existing .css
from full filename path and append .min.css
to it. I have tried several solutions but couldn't achieve the expected outcome. I have gone through the uglifycss docs but couldn't find anything. Is there a way I can trim the extension from {} file path?