-
Notifications
You must be signed in to change notification settings - Fork 6
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
More [concrete] examples #15
Comments
Globals need to be declared explicitly:
It says that much in the documentation, but it's a small section so maybe you missed it. I'll see what I can do to emphasize/explain it better. You can There is no grunt plugin for earl grey (as far as I know). I won't make one myself, but if someone else could, that'd be great! Good point about the examples. I will work on an examples repo for the browser to get people started. I have a couple ideas already. |
OK, thanks. I missed that section indeed.
it certainly works in a browser with my simple test page, but I am not sure if that is the most efficient way? Specifically, do I have to use earlify transform? Would it bring any benefits? And if so how can I use it with gulp? |
I thought https://github.com/gulpjs/gulp/blob/master/docs/recipes/browserify-transforms.md For what it's worth, I use something like this. It may not be the best (honestly, I as I re-read it, I rewrote half of it), it's just what I hacked together for my own usage:
It does something subtly different from you: each file in If you only want one bundle you can simplify by removing the await all with the each loop, the eos call, and use Another thing is that I require earlify/browserify inside the task. This spares you from requiring it when you run other tasks, so e.g. |
My code didn't work for multiple modules in the src tree, I had to write temporary .js files for browserify, it currently looks like this:
So, I think I'll use your code, thanks for suggestions |
The language looks interesting but the problem is that I failed to make it work on my test browser projects. I am not sure how to make it compile for a browser, both gulp example and earlify complain about missing globals, e.g. window, document. I am also not sure how to require jquery and use it on a page. On top of that I usually use grunt and don't know much about gulp.
Given that a lot of JS based languages are used in a browser context, I think it would be good to have a couple of examples explaining how Earl can be employed there.
The text was updated successfully, but these errors were encountered: