As stated in title, this patch adds ability to generate maps for merged files. Not after concatenation, but before. Turns out there is even an issue that could be fixed by this PR: #35.
How to use:
Add sourceMap property to MergeIntoFile constructor's options. sourceMap can be a boolean or object with these properties, both optional:
sourceRoot (string - root path to map merged files against),
inlineSources (boolean - set to true to include source files into map files).
Use callback in files array that should look like this in the simplest case:
As stated in title, this patch adds ability to generate maps for merged files. Not after concatenation, but before. Turns out there is even an issue that could be fixed by this PR: #35.
How to use:
sourceMap
property toMergeIntoFile
constructor's options.sourceMap
can be a boolean or object with these properties, both optional:sourceRoot
(string - root path to map merged files against),inlineSources
(boolean - set to true to include source files into map files).In this callback map is an instance of SourceMapGenerator. It can be passed further to Terser or processed in any other way you'd like.