Are you using Browserify...?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Are you using Browserify...?

sebastianconcept
...to deploy your amber app?

http://browserify.org/

how are you bundling all your js?

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Are you using Browserify...?

Herby Vojčík
Amber uses AMD, so it in clash with browserify - they both define the global variable 'require'.

The best case would be to eschew browserify completely. If not possible, then either browserify subpart or AMD subpart of the app must be isolated in some namespace and/or IIFE, probably by some build process that can concatenate files and change some naming.

If you only want use browserify (that is, CommonJS) modules and you have no reason to use browserify per se, you can use RequireJS, it is able to detect them and use them properly, most of the time. You need to map names to paths and shim undetectable (read: not parseable from initial require() calls in the module source) dependencies by hand in require.config call.

Herby

Sebastian Sastre <[hidden email]>napísal/a:

...to deploy your amber app?

http://browserify.org/

how are you bundling all your js?

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Are you using Browserify...?

sebastianconcept
So this might make sense then
https://github.com/yeoman/grunt-usemin



On Monday, May 19, 2014 6:37:11 AM UTC-3, Herby wrote:
Amber uses AMD, so it in clash with browserify - they both define the global variable 'require'.

The best case would be to eschew browserify completely. If not possible, then either browserify subpart or AMD subpart of the app must be isolated in some namespace and/or IIFE, probably by some build process that can concatenate files and change some naming.

If you only want use browserify (that is, CommonJS) modules and you have no reason to use browserify per se, you can use RequireJS, it is able to detect them and use them properly, most of the time. You need to map names to paths and shim undetectable (read: not parseable from initial require() calls in the module source) dependencies by hand in require.config call.

Herby

Sebastian Sastre <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="7ukP0nezdWgJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">sebastia...@...>napísal/a:

...to deploy your amber app?

<a href="http://browserify.org/" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fbrowserify.org%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNEcSYZndrXiCbCtWXoIVAYtmfDyog';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fbrowserify.org%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNEcSYZndrXiCbCtWXoIVAYtmfDyog';return true;">http://browserify.org/

how are you bundling all your js?

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="7ukP0nezdWgJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">amber-lang+...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Are you using Browserify...?

Herby Vojčík


Sebastian Sastre wrote:
> So this might make sense then
> https://github.com/yeoman/grunt-usemin

I don't know, too long.

Ad I said, if you want to use CommonJS modules, just use them as is via requirejs. Otherwise, ... you should find out how to cope.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.