Skip to content

Commit

Permalink
Example: use default main module
Browse files Browse the repository at this point in the history
  • Loading branch information
zengfenfei committed Jan 3, 2016
1 parent 5a84c61 commit a8f4348
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions example/foo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//var xhr = require('xhr')
document.body.innerHTML += "<p>The main module loaded</p>";
console.log('Before require')
var Dog = require('./dog')
console.log('After require', Dog)
Expand All @@ -9,3 +10,5 @@ exports.foo = function () {
}

console.log('core module util', require('util'))


6 changes: 4 additions & 2 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<title>Browser Loader</title>
</head>
<body>
<div>loader test</div>
<script main="./foo.js" src="../out/browserify-loader.js"></script>
<h1>Loader Example</h1>

<p>Open console of your devtools to see more info.</p>
<script src="../out/browserify-loader.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"main": "./foo.js"}

0 comments on commit a8f4348

Please sign in to comment.