Re: [nodejs] Re: Only by 1kb, is it possible to make node.js modules run in browser, like browserify, seajs or requirejs+r.js?

2014-03-07 Thread Tim Caswell
Yes, if you just want the node style require system in the browser and are willing to use a transform step, it's pretty easy. I'm doing this for my tedit project. I have two build styles that I use. One wraps all the source code in amd style wrappers and then uses a tiny bootstrap program to

Re: [nodejs] Re: Only by 1kb, is it possible to make node.js modules run in browser, like browserify, seajs or requirejs+r.js?

2014-03-07 Thread Tim Caswell
I should mention, you don't have to use tedit, I'm just giving that as an example. My point is it doesn't take much to have a node-style require in the browser, especially if you're willing to use a transform step. Browserify is very good at this and is quite full featured. I think there may be

Re: [nodejs] Re: Only by 1kb, is it possible to make node.js modules run in browser, like browserify, seajs or requirejs+r.js?

2014-03-07 Thread Simeon Chaos
Thanks. Good stuffs. 在 2014年3月8日星期六UTC+8上午2时05分47秒,Tim Caswell写道: Yes, if you just want the node style require system in the browser and are willing to use a transform step, it's pretty easy. I'm doing this for my tedit project. I have two build styles that I use. One wraps all the

[nodejs] Re: Only by 1kb, is it possible to make node.js modules run in browser, like browserify, seajs or requirejs+r.js?

2014-03-06 Thread Simeon Chaos
Sorry for the typo: browserify will add at least minified 150 bytes -- should be about 350 bytes after minified 在 2014年3月7日星期五UTC+8下午2时56分43秒,Simeon Chaos写道: Do you need packages and modules in browser? With require.js you can define and require something (AmdJS spec) in 15kb. Need run