3

I want grunt-browserify to include backbone in my project.

Exerpts from my gruntfile:

...
browserify: {
  vendor: {
    src: ['client/requires/**/*.js'],
    dest: 'build/vendor.js'
  },
..

This is the errormessage when running grunt browserify:

Running "browserify:vendor" (browserify) task

Error: Cannot find module 'underscore' from 'somePath/client/requires/backbone'

As I understand the error message, browserify is looking for underscore from within the backbone folder where it can't find it.

I'm quite new to the whole grunt and browserify stack, but might the problem be that browserify is searching for require statements in the backbone file, but that the underscore file is not made within the common js convention, i.e not using module.exports?

I have been following a guide: Boilerplate web app using Backbone .... I have copied most of this project, but updated all dependencies. I have incorporated my own server side code, which is working fine after building it with a modified gruntfile. The only one thing not working is the browserify task.

I have tried to modify my package.json file to include browserify and even browserify-shim but this doesnt seem to be the problem.

0 Answers0