Code Monkey home page Code Monkey logo

Comments (4)

srod avatar srod commented on May 23, 2024

Hi,

Thank you for your report, I will check that.

from node-minify.

aaronleesmith avatar aaronleesmith commented on May 23, 2024

Update: it seems like this bug shows up with using the .minify function back to back (as in while looping through an array of directories, each with lots of files to combine).

What seems to be happening is that the minify program is stepping on its own feet when called in this manner. Here is an example of the code:

var paths = {///array of paths}}
var out = {{//array of outfiles}}

for(key in paths) {
    inPath = paths[key];
    outPath = out[key];
    files = fs.readdirSync(inPath)
    files = files.sort();
    if(files.length > 0) {

        for(i = 0; i < files.length; i++)
        files[i] = inPath + "/" + files[i];

    new compressor.minify({
    type: compressionType,
    buffer : 1000 * 2056,
    fileIn: files,
    fileOut: outPath,
    callback: function(err){
        if(err)
            console.log("Error using in-path:'" + inPath + "', out-path:'" + outPath + "'. Error: " + err);
    }
});

}
}

from node-minify.

srod avatar srod commented on May 23, 2024

OK, I try with a small example and it's working.

var http = require('http'),
    compressor = require('node-minify');

http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Hello World\n');
}).listen(1337, "127.0.0.1");

new compressor.minify({
    type: 'no-compress',
    fileIn: ['test/base.js', 'test/base2.js'],
    fileOut: 'test/base-onefile.js',
    callback: function(err){
        console.log(err);
    }
});

console.log('Server running at http://127.0.0.1:1337/');

Can you give me a sample of code ?

from node-minify.

srod avatar srod commented on May 23, 2024

Closing it, reopen if it still occur, thanks.

from node-minify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.