3 ms·
In my opinion a bundler should bundle and nothing else. Transforms should be implemented as externals tools that package assets and whatnot as CommonJS modules.
by thibauts 12y ago
In my opinion a bundler should bundle and nothing else. Transforms should be implemented as externals tools that package assets and whatnot as CommonJS modules. One benefit among others would be the ability to implement the build process as a Makefile. These tools try to do to much at once.
- mattdesl 12y agoI would say it depends. brfs is perfect since you don't change any node source to support the browser. glslify is another useful one if you're authoring WebGL modules. Not only does it statically analyze the uniforms/attributes for use at runtime, but it also allows for modularization, minification, optimization, etc. On the other hand, transforms like cssify and hbsfy might be better suited only for the application level. In an ideal world; these transforms would be completely decoupled from the bundler so that Webpack, Browserify, or anything else can use them in the same way.
- thibauts 12y agoThough brfs can be nice to make a module instantly usable in the browser I think it is highly misleading because it skews fs semantics a lot. It shouldn't be encouraged in cases where other solutions are available. I can't talk about glsify because I don't know it, though trying so hard to make the browser behave like node has a lot of benefits at first, I think it is a very brittle solution in the long run.