babel-plugin-replace-ts-export-assignment
Version:
Allows export assignment syntax to be used when compiling TypeScript with babel
15 lines • 420 B
JavaScript
;
module.exports = ({ template }) => {
const moduleExportsDeclaration = template(`
module.exports = ASSIGNMENT;
`);
return {
name: 'replace-ts-export-assignment',
visitor: {
TSExportAssignment(path) {
path.replaceWith(moduleExportsDeclaration({ ASSIGNMENT: path.node.expression }));
}
}
};
};
//# sourceMappingURL=index.js.map