no matter what I do the map is empty on map.toString().
let path = require("path");
let content = fs.readFileSync(".\\" + file, "utf8");
let filename = path.basename(outFile)
const { code } = js(content);
fs.writeFileSync(outFile, content);
fs.writeFileSync(outMinFile, code);
let gen = new sm.SourceMapGenerator({
file: filename,
sourceRoot: "./",
});
gen.setSourceContent("CMS.Layout.js", content);
fs.writeFileSync(outMap, gen.toString());
results in:
{"version":3,"sources":[],"names":[],"mappings":"","file":"CMS.Layout.js","sourceRoot":"./","sourcesContent":[]}
what am I doing wrong?
smset?new sm.SourceMapGeneratordoesn't workjsvariable ? On my side I tested the usage ofgenerate-source-mapbut no luck with ES6 (?) syntax: the strings with backquote throw an error. Not surprising, asgenerate-source-maphas been published 6 years ago, but I don't know which equivalent library I could use.