Skip to content

Instantly share code, notes, and snippets.

@davidtheclark
Created June 8, 2015 22:21
Show Gist options
  • Save davidtheclark/0e7a289f30fb4c9c71b7 to your computer and use it in GitHub Desktop.
Save davidtheclark/0e7a289f30fb4c9c71b7 to your computer and use it in GitHub Desktop.

Revisions

  1. davidtheclark created this gist Jun 8, 2015.
    10 changes: 10 additions & 0 deletions bundle.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    var pathmodify = require('pathmodify')
    var browserify = require('browserify')

    browserify('./index.js')
    .plugin(pathmodify(), {
    mods: [
    pathmodify.mod.dir('foo', './test/foo')
    ]
    })
    .bundle();
    3 changes: 3 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    var bar = require('foo/bar');

    bar();
    5 changes: 5 additions & 0 deletions test-foo-bar.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    // put this in subdir ./test/foo

    module.exports = function() {
    console.log('bar');
    }