Closed ds82 closed 8 years ago
Try to use the browserify
configuration instead of bundle.transform
as shown in the project readme.
The reason you might run into trouble is that prebundle
is called with every bundle, registering your transform + plugin repeatedly.
As the title suggests, I'm not able to get karma-browserify, aliasify and proxquireify to work together. I opened the bug here, because it works if I just use browserify with aliasify & proxquireify to build the bundle, but not if I do it with karma-browserify.
I created a demo repo to reproduce the behaviour: https://github.com/ds82/karma-proxyquire-aliasify-test
Clone and
npm install
. Then you can build two test bundles withnode browserify.build.js
-> bundles are inbuild/{bundle,test}.js
The file
spec/main.spec.js
loads a dependencysome-dep
which does not really exist, but is aliased via aliasify tosrc/dep.js
. If you look atbuild/test.js
the aliased filesrc/dep.js
got included -> all fine :thumbsup:Now run karma:
karma start karma.conf.js
that results in:
If I'm not missing something, I use the same config for karma-browserify in
karma.conf.js
as I do for browserify inbrowserify.build.js
.I'm thankful for any guidance here ..