exceptionless / Exceptionless.JavaScript

Exceptionless JavaScript client
http://exceptionless.com
Apache License 2.0
59 stars 24 forks source link

Upgrade dependencies and fix linting issues. #105

Closed niemyjski closed 1 year ago

niemyjski commented 3 years ago

Update: This pr addresses dependencies, we have a plan to solve this in the next update.

This should resolve all CJS import issues,

I think what was happening is that by default we were saying the main script was index.js (https://github.com/exceptionless/Exceptionless.JavaScript/blob/master/packages/browser/package.json#L27) and that all consumers should use this and tree shake. The problem with this is that we had a dependency on stacktrace-js and import for stacktrace-js so it would always be loaded as a cjs umd module. If you used the bundled version transpiled with esbuild it would have worked.

This pr has a prebuild action to convert the stacktrace-js dependency and it's dependencies to esm local file, the build then references this file instead of the cjs requires and then post build copies this transpiled file to the dist folder (tsc doesn't copy js files or any non ts file by default).

ejsmith commented 3 years ago

Interesting. Hope it works.

niemyjski commented 1 year ago

I still need to come up with a solution for: https://github.com/stacktracejs/stacktrace.js/issues/230