Skip to content

Instantly share code, notes, and snippets.

@longlho
Created August 20, 2019 02:38
Show Gist options
  • Save longlho/52a158d3aa30f2ebe0df7accb75ce80c to your computer and use it in GitHub Desktop.
Save longlho/52a158d3aa30f2ebe0df7accb75ce80c to your computer and use it in GitHub Desktop.
transformer-p6.ts
if (newNode) {
// Link external CSS file in source map
const externalCssSource = ts.createSourceMapSource(
cssPath,
readFileSync(cssPath, "utf-8")
);
ts.setSourceMapRange(newNode, {
source: externalCssSource,
pos: node.pos,
end: node.end
});
return newNode;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment