eugeneware / debowerify

A browserify transform to enable the easy use of bower components in browserify client javascript projects. This can be used in conjunction with deamdify to require AMD components from bower as well.
493 stars 51 forks source link

custom bower directory in browserify result js #51

Closed gabel closed 9 years ago

gabel commented 9 years ago

I have a custom .bowerrc and in the resulting "bundle.js" including the complete path (see bundle.js below). Everything else looks good, except this path related problem.

$ browserify index.js -o bundle.js

Result

bundle.js

...
function(require,module,exports){
require("./../../../../projectname/vendor/bower_components/seiyria-bootstrap-slider/js/bootstrap-slider.js");
...
-- all good from here --
/*! =========================================================
 * bootstrap-slider.js
....

Setup

index.js

require("seiyria-bootstrap-slider");

.bowerrc

{
  "directory": "../../../../projectname/vendor/bower_components",
  "json": "bower.json",
  "analtycs": false
}

package.json

{
  "name": "Projectname",
  "version": "1.0.0",
  "dependencies": {
  },
  "browserify": {
    "transform": [
      "debowerify"
    ]
  },
  "devDependencies": {
    "browserify": "^4.1.5",
    "debowerify": "^0.9.1"
  }
}

I have the same issue with all other require statements related to bower as well.

gabel commented 9 years ago

using npm now directly with napa.. closed