MaxArt2501/share-this

Source map support

Closed this issue · 1 comments

A project that utilizes this package and has source maps, emits this sort of trace when there is an error thrown from this package:

TypeError: Argument not optional
1
File "webpack:///./node_modules/share-this/dist/share-this.js" line 1 col 1655 in a
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"...
2
File "webpack:///./node_modules/share-this/dist/share-this.js" line 1 col 3262 in f
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"...
3
File "webpack:///./node_modules/share-this/dist/share-this.js" line 1 col 3162 in Anonymous function
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"...

I'm not 100% sure how to resolve this, it's either going to be one of two ways:

  1. Emit a source map .js.map alongside each file in dist/. I'm unsure if typical tooling can utilize source maps like this, but maybe!
  2. Maintain a ES2015 module entry point - so instead of importing share-this, the user can import share-this/es2015 and whatever compilation process a user uses can create the mappings.

I need to review the whole code generation process, actually.
It will be hopefully solved by then.