Skip to content

Instantly share code, notes, and snippets.

@programmarchy
Created October 29, 2014 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save programmarchy/1655e571b6bb36f17c02 to your computer and use it in GitHub Desktop.
Save programmarchy/1655e571b6bb36f17c02 to your computer and use it in GitHub Desktop.
browserify issue #850
# this works ok
browserify -r './kitten.js:nyan' -e pizza.js > bundle.js
# but full-paths causes an error: Uncaught Error: Cannot find module .../kitten.js
browserify -r './kitten.js:nyan' -e pizza.js --full-paths > bundle.js
<!DOCTYPE html>
<html>
<head>
<title>browserify example</title>
</head>
<body>
<script src = "./bundle.js"></script>
</body>
</html>
module.exports = function() {
this.meow = function() {
console.log('a kitten says meow');
}
}
var EventEmitter = require('events').EventEmitter;
var Nyan = require('nyan');
var emitter = new EventEmitter;
emitter.on('pizza', function(message) {
console.log(message);
});
emitter.emit('pizza', 'pizza is extremely yummy');
var nyan = new Nyan;
nyan.meow();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment