NPM module for concatenating files and generating source maps.
var concat = new Concat(true, 'all.js', '\n');
concat.add(null, "// (c) John Doe");
concat.add('file1.js', file1Content);
concat.add('file2.js', file2Content, file2SourceMap);
var concatenatedContent = concat.content;
var sourceMapForContent = concat.sourceMap;
Initialize a new concat object.
Parameters:
- generateSourceMap: whether or not to generate a source map (default: false)
- outFileName: the file name/path of the output file (for the source map)
- separator: the string that should separate files (default: no separator)
Add a file to the output file.
Parameters:
- fileName: file name of the input file (can be null for content without a file reference, e.g. a license comment)
- content: content (Buffer or string) of the input file
- sourceMap: optional source map of the input file (string). Will be merged into the output source map.
The resulting concatenated file content (Buffer).
The resulting source map of the concatenated files (string).