marked-element icon indicating copy to clipboard operation
marked-element copied to clipboard

`marked.Renderer` is not a constructor when using pikapkg/web

Open jarrodek opened this issue 6 years ago • 2 comments

Description

This may be similar to #99. I'm using pikapkg/web (as suggested in Polymer's project issue) to enable native imports which are required for Electron app. After few days I made my project to work but now I see bunch of errors when using marked element. So the Pika web transforms marked library and marked object has only default property and this property has package export. Now I am not sure how to deal with this issue as Pica does not have "exclude" option to not transform it as ES module. Maybe we could use some type check when constructing the instance of marked renderer?

jarrodek avatar Apr 15 '19 14:04 jarrodek

@jarrodek You should be able to use the whitelist property on @pikapkg/web to skip the transformation of marked. Check out this comment. https://github.com/pikapkg/web/issues/40#issuecomment-482622609

stramel avatar Apr 15 '19 14:04 stramel

I tried it but no luck. It still gets transformed. As a walkaround I am calling a script on postinstall script to replace marked.Renderer with marked.default.Renderer and later marked() with marked.default().

jarrodek avatar Apr 15 '19 21:04 jarrodek