Created
September 27, 2011 23:57
-
-
Save parshap/1246605 to your computer and use it in GitHub Desktop.
node-browserify watch test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file should be stored as js/foo.js | |
console.log("test") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- This file should be stored as public/index.html --> | |
<!doctype html> | |
<html> | |
<body> | |
<script type="text/javascript" src="browserify.js"></script> | |
<script type="text/javascript"> | |
require("./foo"); | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var connect = require('connect'), | |
browserify = require("browserify"), | |
server = connect.createServer(); | |
server.use(connect.static("public")); | |
server.use(browserify({ | |
require : __dirname +'/js/foo.js', | |
watch: true, | |
})); | |
server.listen(process.env.PORT || 8500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment