grunt-browserify
grunt-browserify copied to clipboard
Cannot find module './support/isBuffer'
I have a directory with tests I wish to browserify. if I do it by hand everything works fine:
$ cd tests/browser
$ browserify -o tests.js *.js
but in trying to automate it by putting the following into the Gruntfile.js:
browserify: {
test: {
src: ['test/browser/*.js'],
dest: 'test/browser/tests.js'
}
},
something goes wrong and when I try to run the tests I get:
$ grunt test-web Running "browserify:test" (browserify) task
Error: Cannot find module './support/isBuffer' from '/Users/ekkis/Development/tst/test/browser' Warning: Error running grunt-browserify. Use --force to continue.
Aborted due to warnings.
am I misconfiguring the plugin? help?
I have the same problem, I think it's trying to look for
node_modules/grunt-browserify/node_modules/browserify/node_modules/util/support/isBuffer.js
but it's looking for it in the current project directory.
I managed to fix my problem, seems like you can't use globbing patterns in files.src array if you also have a files.dest.
What caused my error:
files: {
src: ['path/to/files/*.js'],
dest: 'whatever/file.js'
}
The fix:
files: {
'whatever/file.js': ['path/to/files/*.js']
}
not sure if this is a bug or intentional.
nah. you can use globs. I got it to work without changing the configuration but I no longer know what I did to make it work... I think I upgraded npm
@ekkis I have the same problem. Could you find a solution to it?
@chiragmongia do an upgrade first. I think that solved it for me
Related issue here: https://github.com/browserify/browserify/issues/1531