I installed debowerify in my project and added its transform in my Gruntfile.js, here's a snippet:
grunt.initConfig({
browserify: {
app: {
files: { 'public/javascripts/build/app.js': ['public/javascripts/app.js'] },
options: {
transform: ['node-underscorify','debowerify']
}
}
}
});
Then I installed a module (e.g. bower install bootstrap --save).
In my app.js file I tried to include that module:
var bootstrap = require('bootstrap');
... and got:
Running "browserify:home" (browserify) task Error: module "bootstrap" not found
My folder structure looks like that:
/
- app/
- bower_components/
- bootstrap/
- node_modules/
- public/
- javascript/
- app.js
- build/
- app.js
- bower.json
- Gruntfile.js
You can check my debowerify setup (without node-underscorify) in https://github.com/mallim/browserify_angular_minify
At the same time, I will suggest that instead of
var bootstrap = require('bootstrap');
I will try
require('bootstrap');