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

how do I use in the browser? #40

Closed
hodeyp opened this issue Apr 12, 2015 · 1 comment
Closed

how do I use in the browser? #40

hodeyp opened this issue Apr 12, 2015 · 1 comment

Comments

@hodeyp
Copy link

hodeyp commented Apr 12, 2015

Hi, I am trying to use Webmake to generate a browser compatible build. I have built using web make index.js bundle.js and then included bundle.js in my index.html.

However when I try to call memoize in my js I get an error memoize is not defined - how am I meant to call the function?

@medikoo
Copy link
Owner

medikoo commented Apr 12, 2015

program.js:

var memoize = require('memoizee');

if (memoize) {
  console.log("Memoize is defined!");
} else {
  console.log("Memoize not working!");
}

Then in shell:

$ webmake program.js bundle.js

Of course memoize won't be visible outside the bundle, but it's how CJS works, it's perfect encapsulation you should not expect utilities to be exposed old school way on globals.

@medikoo medikoo closed this as completed Apr 12, 2015
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