Add sourcemaps
sethidden opened this issue · comments
Right now when you get an error related to vue-frag, the error will read like this (I use Firefox - the Chrome error message is a bit different in this case):
can't access property Symbol(), a is null
Notice the a
- there's no variable named a
in the enteriety of src/frag.js. This is because the a
comes from the already minified file frag.esm.js
The above error happens on line 1 of frag.esm.js, but that's not very helpful because the whole file is just one line (again - minification)
The error messages would be more helpful if they had access to sourcemaps (browsers will pick them up automatically obviously), they'd be like can't access property Symbol(), element is null
at line 15 (or something like that)
When I install vue-frag and go to node_modules/vue-frag, I see only the dist folder, package.json and README.md
Since the original unminified source is not shipped in the package, it's not possible to "sourcemap" to any file
To show that my webpack configuration is correct, see what vuex.esm.js looks like (frag.esm.js was already shown above):
I think changing main: in package.json to src/frag.js and also adding the src/ folder to files: should do the trick
same issue as IdentityModel/oidc-client-js#753
Good call. I forgot about the source maps.
I will not publish src
because it's allowed to assume specific bundler configuration (which will not be available in consuming builds), but I will add minified and non-minified versions.
If you're encountering a bug, feel free to open another issue 👍