source: imaps-frontend/node_modules/clean-css/lib/reader/rebase-local-map.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 446 bytes
Line 
1var path = require('path');
2
3function rebaseLocalMap(sourceMap, sourceUri, rebaseTo) {
4 var currentPath = path.resolve('');
5 var absoluteUri = path.resolve(currentPath, sourceUri);
6 var absoluteUriDirectory = path.dirname(absoluteUri);
7
8 sourceMap.sources = sourceMap.sources.map(function(source) {
9 return path.relative(rebaseTo, path.resolve(absoluteUriDirectory, source));
10 });
11
12 return sourceMap;
13}
14
15module.exports = rebaseLocalMap;
Note: See TracBrowser for help on using the repository browser.