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

Calling two functions in the same javascript file #228

Closed
juanpabloaj opened this issue Mar 25, 2017 · 1 comment
Closed

Calling two functions in the same javascript file #228

juanpabloaj opened this issue Mar 25, 2017 · 1 comment

Comments

@juanpabloaj
Copy link

If I have this javascript file

// hello.js
var hello = function () {
  return 'hello';
};

var bye = function () {
  return 'bye bye';
};

I can use hello() with this configuration

"browserify": {
    "transform": ["browserify-shim"]
  },
  "browser": {
    "hello": "./hello.js"
  },
  "browserify-shim": {
    "hello": {"exports": "hello"}
  }

And call with

var hello = require('hello');
hello()

How can I use the both functions bye() and hello() ?

@juanpabloaj juanpabloaj changed the title Call two functions in the same javascript file Calling two functions in the same javascript file Mar 25, 2017
@bendrucker
Copy link
Collaborator

browserify-shim is only capable of handling one export per module so at the moment it cannot accomplish what you're requesting.

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