1

I was wondering if RequireJS's Optimizer (r.js) does more besides concatenating and minifying my javascript files.

For example, could I use Gulp to minify and concatenate my files?
Their result would be the same?

Thank you

Alexandru
  • 833
  • 1
  • 8
  • 24
  • I'm not familiar with `r.js`, but Gulp can do a whole lot more than just minify and concatenate files. But if that's all you need to do, Gulp is definitely a viable solution. – fubar Jul 16 '17 at 22:01

1 Answers1

1

Gulp is not a tool for minifying and concatenating files, but rather a framework for all sorts of developement automation, and there are modules for Gulp which do exactly that, as well as many other tools that you can use with Gulp.

r.js is mainly for optimization of the code. You can also use r.js and Gulp together.

Lukas Bach
  • 3,559
  • 2
  • 27
  • 31
  • I understand that, but what does "r.js" actually do besides minify and concatenate? Thanks – Alexandru Jul 17 '17 at 07:27
  • 1
    As far as I know, it mostly does that, but also some more intelligent optimizations rather than just minification: It looks for modules which it can combine to make the page faster, or it embedes css stylesheets into each other instead of using imports. It doesn't add additional features to your code, so that's basically it. – Lukas Bach Jul 17 '17 at 08:13