A CommonJS Loader for browserify workflow.
browserify-loader
is another CommonJS loader for browserify workflow. With BL, You don’t need any tools like watchify, browserify-middleware to auto build and serve bundle *js in development env.
browserify-loader
is similar with requirejs, but:
- Follow module loading algorithm
- get rid of wrapper code like
define()
- be compatible all
npm
package and allbower
components witch supportCommonJS
. likeunderscore
,backbone
,jQuery
and so on.
Download browserify-loader
with npm
:
$ npm install browserify-loader2
Put browserify-loader.min.js
in your page:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script main="./app.js" src="node_modules/browserify-loader2/out/browserify-loader.min.js"></script>
</body>
</html>
Then, browserify-loader
will start to run for main
file in your package.json
file.
- main: the main entrance script like
app.js
innode app.js
- defineName: The name of the define function. Not supported yet.
- forceExt: Force loading files with valid extensions only, ignore files with invalid extenstion. Not supported yet.
- forceDir: Force path which ends with
/
to be a directory module. Not supported yet.
Look into example/index.html
.
The module loader has test cases written in Qunit, open test/index.html
.