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

Runninh in node vs browser #32

Open
ainthek opened this issue Mar 16, 2017 · 1 comment
Open

Runninh in node vs browser #32

ainthek opened this issue Mar 16, 2017 · 1 comment

Comments

@ainthek
Copy link

ainthek commented Mar 16, 2017

I may have missed something,
I want my original code to ALWAYS run in node and sometimes in browser. But when i use require(glob) syntax it brakes node API and code will not run in node of course. How is this module to be used in pure node environment ? We need both.

@call-a3
Copy link
Collaborator

call-a3 commented Mar 18, 2017

This module is not intended to enhance or replace node's built-in require functionality. Therefore, you'll never be able to execute source code directly if it contains our alternative syntax. What you could do however, is use browserify similar to how you'd use it to build for the browser, but use the --node option to build your bundle for the server instead. That should give you a bundle that's executable in node

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

No branches or pull requests

2 participants