coderaiser / minify

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

fix(output) css file without rules results in '' == true #32

Closed mwitjes closed 9 years ago

mwitjes commented 9 years ago

Using the command line on windows, minifying a css file without any rules (only comments) results in '' == true. I assume the file is interpreted as a javascript file. If so, is there a way to force the type of minification on windows using command line?

To reproduce:

coderaiser commented 9 years ago

Just tried the same, could not reproduce.

minify test.css #  /* dummy comment */
# just empty string

Try to install last version of minify. About flags, there is such, try this on windows:

type 1.css| minify -css
mwitjes commented 9 years ago

Thank you for your quick response.

I think I have the latest version via npm: ├─┬ minify@1.4.22 │ ├─┬ clean-css@3.4.6 │ │ ├─┬ commander@2.8.1 │ │ │ └── graceful-readlink@1.0.1 │ │ └─┬ source-map@0.4.4 │ │ └── amdefine@1.0.0

I am still getting the error. See the screenshot below afbeelding 183

When entering type 1.css| minify -css on the command prompt I get an error "The system cannot find the file specified"

coderaiser commented 9 years ago

your file named test.css so you should try

type test.css|minify -css

What node version are you use?

coderaiser commented 9 years ago

Here is my log, try this:

D:\Temp\31337>echo "/* hello world */" > test.css
D:\Temp\31337>minify test.css
""
D:\Temp\31337>type test.css|minify -css
""
mwitjes commented 9 years ago

Thank you. I don't think the file should contain double quotes. Take a look at my log. It still outputs '' == true without the flag.

image

But with the flag it appears to work. Thank you very much.