Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global behavior if commonjs not available #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lgrignon
Copy link

Sorry, just a small fix to use this in a browser by simply importing it through a script tag.

Thanks for your simple, but useful library :)

@lgrignon
Copy link
Author

NB: travis build fails but it seems to be not related

@lgrignon
Copy link
Author

lgrignon commented Mar 27, 2018

Fixed by upgrading node version. If you could please merge & deploy to npm, it would be great :)

@@ -50,4 +50,6 @@ var StackTraceParser = {
};


module.exports = StackTraceParser;
if (typeof module != 'undefined') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that is enough? The main entry point of the project is the index.js which also uses module.exports to require that stuff.

@Calamari
Copy link
Contributor

What is the problem you are trying to solve? Do you want to use this in a browser?

I think there are way more possibilities to get this to run in browser nowadays.

@lgrignon
Copy link
Author

lgrignon commented Mar 28, 2018

I run it into a browser. I cannot use a module shim for many reasons. And yes, it is enough to run it in a browser since I made it work yesterday :) (However, I include the stacktrace-parser.js file instead of the index.js)
It is a quick fix for users like me who cannot use a module loader.

@Calamari
Copy link
Contributor

@lgrignon I just merged a complete update to the product using babel. I guess that would solve your problem when releasing a new version, right?

@keithamus
Copy link
Contributor

FYI @Calamari this would be fixed by simply linking main to the umd bundle - which includes a global export in the factory wrapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants