coderaiser / minify

Minifier of js, css, html and img
https://coderaiser.github.io/minify
MIT License
228 stars 29 forks source link

feature: Add support for .minify.json config file #72

Closed code-forger closed 3 years ago

code-forger commented 3 years ago

This closes #69 by allowing the user to provide a file in the current working directory under .minify.json

If the file exists, but cannot be parsed, minify will exist with an error such as the one below (full file path redacted)

Config file at /Users/[Redacted]/.minify.json could not be parsed with error
Unexpected token } in JSON at position 49
coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 62858a73cca2ed81dc687d467c16f5e526d74b6e on code-forger:feature/configFile into 4125fba1290e78d711a9407b9e297a95f492e996 on coderaiser:master.

coderaiser commented 3 years ago

That’s amazing! Could you please move out this to a file in libdirectory and use try-catch and find-up and add tests similar to @putout/cli-match

code-forger commented 3 years ago

That’s amazing! Could you please move out this to a file in libdirectory and use try-catch and find-up and add tests similar to @putout/cli-match

Since I am catching and re-throwing the error to add more information, I couldn't find a clean way of adding try-catch here, so I didn't.

Ive added find-up, and Ive added some unit tests as requested.

coderaiser commented 3 years ago

Thanks a lot 🎈 !

coderaiser commented 3 years ago

Landed in v7.1.0 🎉 Maybe you want to add some documentation to this feature :)?

code-forger commented 3 years ago

🥳

Maybe you want to add some documentation to this feature :)?

I'll make that next on my list