[Pkg-javascript-devel] Bug#942045: rollup 0.68.2 transition: build fails with TypeError: magic_string_1.SourceMap is not a constructor

Pirate Praveen praveen at onenetbeyond.org
Thu Oct 10 10:14:58 BST 2019


Control: affects -1 rollup

On Thu, 10 Oct 2019 14:16:44 +0530 Pirate Praveen
<praveen at onenetbeyond.org> wrote:
> Control: reassign -1 node-magic-string
> 
> I think this comes from the inconsistent exports in es.js and cjs.js
> 
> es.js has this line at the end,
> 
> export { Bundle, SourceMap };
> 
> but cjs.js or umd.js does not export these.
> 

This patch fixes the issue.

--- a/src/index-legacy.js
+++ b/src/index-legacy.js
@@ -2,6 +2,7 @@
 import Bundle from './Bundle.js';

 MagicString.Bundle = Bundle;
+MagicString.SourceMap = SourceMap;
 MagicString.default = MagicString; // work around TypeScript bug
https://github.com/Rich-Harris/magic-string/pull/121

 export default MagicString;



More information about the Pkg-javascript-devel mailing list