Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

put --plugin back but without the argument parsing

  • Loading branch information...
commit 1ea6f88adae0c3b4c6f282f754e43a6ed2f3e804 1 parent a6a514a
@substack authored
Showing with 14 additions and 1 deletion.
  1. +2 −0  README.markdown
  2. +11 −0 bin/cmd.js
  3. +1 −1  package.json
View
2  README.markdown
@@ -58,6 +58,8 @@ Options:
a file for caching.
[default: true]
--debug, -d Switch on debugging mode with //@ sourceURL=...s. [boolean]
+ --plugin, -p Use a plugin.
+ Example: --plugin aliasify
--prelude Include the code that defines require() in this bundle.
[boolean] [default: true]
--watch, -w Watch for changes. The script will stay open and write updates
View
11 bin/cmd.js
@@ -44,6 +44,12 @@ var argv = require('optimist')
desc : 'Switch on debugging mode with //@ sourceURL=...s.',
type : 'boolean'
})
+ .option('plugin', {
+ alias : 'p',
+ desc : 'Use a plugin.\n'
+ + 'Example: --plugin aliasify'
+ ,
+ })
.option('prelude', {
default : true,
type : 'boolean',
@@ -90,6 +96,11 @@ if (argv.noprelude || argv.prelude === false) {
}
if (argv.ignore) bundle.ignore(argv.ignore);
+([].concat(argv.plugin || [])).forEach(function (plugin) {
+ var resolved = resolve.sync(id, { basedir : process.cwd() });
+ bundle.use(require(resolved));
+});
+
([].concat(argv.alias || [])).forEach(function (alias) {
if (!alias.match(/:/)) {
console.error('aliases require a colon separator');
View
2  package.json
@@ -1,6 +1,6 @@
{
"name" : "browserify",
- "version" : "1.11.1",
+ "version" : "1.11.2",
"description" : "Browser-side require() for js directories and npm modules",
"main" : "index.js",
"bin" : {
Please sign in to comment.
Something went wrong with that request. Please try again.