Skip to content

Commit

Permalink
fix(compile): generate source maps for lib files in widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris committed Jun 8, 2021
1 parent e0f6a41 commit ba8d4c2
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Alloy/commands/compile/compilerUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ var U = require('../../utils'),
_ = require('lodash'),
styler = require('./styler'),
XMLSerializer = require('xmldom').XMLSerializer,
CONST = require('../../common/constants');
CONST = require('../../common/constants'),
sourceMapper = require('./sourceMapper');

///////////////////////////////////////
////////// private variables //////////
Expand Down Expand Up @@ -639,6 +640,20 @@ exports.copyWidgetResources = function(resources, resourceDir, widgetId, opts) {
logger.trace('Copying ' + file.yellow + ' --> ' +
path.relative(compilerConfig.dir.project, dest).yellow + '...');
U.copyFileSync(source, dest);

if (path.extname(source) === '.js') {
sourceMapper.generateSourceMap({
target: {
filename: file,
filepath: dest,
},
data: {},
origFile: {
filename: file,
filepath: source
}
}, compilerConfig);
}
}
});

Expand Down

0 comments on commit ba8d4c2

Please sign in to comment.