I
I
Ingerniated2017-02-05 23:21:27
Node.js
Ingerniated, 2017-02-05 23:21:27

How to merge js or css files into one on a clean node?

Gentlemen, I accidentally stumbled upon a topic about nodes and the work of a packager was described there, but on a clean node it is possible or how to combine a bunch of files of the same type into one?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2017-02-05
@Ingernirated

Combine all *.js files into one:

var exec = require('child_process').exec;

exec("cat *.js > concat.js", function (error, stdout, stderr) {
    console.log('stderr: ' + stderr);
    console.log('stdout: ' + stdout);
    if (!!error) {
        console.error('exec error: ' + error);
    }
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question