srod/node-minify

empty output file

Closed this issue · 5 comments

Hi

I'm using the 2.0 beta, but the result is always a file with the content [object Object].

This is my code:

var compressor = require('node-minify')

compressor.minify({
  compressor: 'uglifyjs',
  input: './js/**/*.js',
  output: './build/build.js',
  callback: function(err, min){
    console.log("Done!");
  }
});

Am I doing something wrong or is this a problem with the beta?

I've tried with an array in input instead of the wildcard with the same result.

In the end I had to manually write the file with fs.writeFile('./build/build.js',min).

I was under the assumption the file was written to the output automatically.

srod commented

Hi,

Yes, the output is written automatically.
I will try with your setup.

srod commented

I have fixed the bug, can you try the new beta ?
You have to install it: npm install node-minify@beta

Thanks! It works now.