-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposing bundles #53
Comments
Can you create a repo that reproduces this? Without seeing where you actually require this bundle from your tests it's hard to see what's up. |
Absolutely. See https://github.com/jedmao/karma-browserify-test In this repo, api.js and foo.js are commonjs files and bar.js is not, but it nonetheless requires the api, which should be exported by browserify. Let me know if you have any further questions. |
Don't be fooled by bar.js because it has a require statement in it. The point is that require should be provided by browserify in the browser, if the api module is exposed. |
Looks like you ran into #52. For the moment you should not include source files in your preprocessors section. |
Other than that I am not exactly sure if this repository reproduces the problems you are experiencing. The api file should be prebundled by browserify, right? In that case you should actually perform the pre-bundling before running the tests via karma. During the tests you should add the prebundled file in the Please try to update the setup and check if you can get it working this way. |
@nikku, thanks. That's actually the missing link that I needed. I think I need to look more into watchify to solve this scenario. |
Feel free to reopen this issue if prebundling + including the bundle does not solve the issue for you. |
I've been struggling the whole day over getting karma to work with browserify. I'm using broccoli-browserify to create a single js file that exposes a
frontend
package, like so:This is working quite well on the development server. I can
require('frontend')
just fine and everything works as expected. The karma configuration, however, has me stumped. I've tried the golden path, based on the readme:I've also tried returning the bundle, in case that had any bearing:
And I've tried to mimic what I was doing with broccoli in this way:
Of course, I wouldn't be here if any of these worked. The error is always the same:
I'm hoping someone can show me the error in my ways and that there is, actually, a solution to this problem.
I'd be happy to submit a PR with a readme or doc update to address this very scenario, once it's solved.
The text was updated successfully, but these errors were encountered: