17 lines
574 B
JavaScript
17 lines
574 B
JavaScript
const glob = require('glob-promise');
|
|
const readFile = require('./readFile');
|
|
|
|
module.exports = (sourcemap_dir_path, js_dir_url) => {
|
|
sourcemap_dir_path = (sourcemap_dir_path + '/').replace(/\/+/g, '/');
|
|
js_dir_url = (js_dir_url + '/').replace(/\/+/g, '/');
|
|
return glob(sourcemap_dir_path + '**/*.map').then(sourcemap_file_paths =>
|
|
Promise.all(
|
|
sourcemap_file_paths.map(sourcemap_file_path =>
|
|
readFile(
|
|
sourcemap_file_path,
|
|
js_dir_url + sourcemap_file_path.slice(sourcemap_dir_path.length, -4),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
};
|