fix bug where files that babel can compile weren't being written when ignored with the --copy-files flag

This commit is contained in:
Sebastian McKenzie 2015-07-28 20:04:32 +01:00
parent bda0d5cc68
commit 5990785ab1

View File

@ -18,9 +18,9 @@ module.exports = function (commander, filenames) {
sourceFileName: slash(path.relative(dest + "/..", src)),
sourceMapTarget: path.basename(relative)
});
if (data.ignored) return;
if (!commander.copyFiles && data.ignored) return;
if (commander.sourceMaps && commander.sourceMaps !== "inline") {
if (data.map && commander.sourceMaps && commander.sourceMaps !== "inline") {
var mapLoc = dest + ".map";
data.code = util.addSourceMappingUrl(data.code, mapLoc);
outputFileSync(mapLoc, JSON.stringify(data.map));