Skip to content

Comment on Require.js is a Terrible Idea

Comments

This is depressingly ill-informed.

Require.js has an optimizer that does exactly what the author suggests: http://requirejs.org/docs/optimization.html

The point is to build your application using AMD, using individual assets in development, and then run the optimizer - which concats and adds a loader - for production.

Alternatively, you can even go a step simpler and always use concatenated files, along with a minimal loader like Almond.js[1]. If you do this, you'll probably want to use something that adds source maps for your concatenated file (for easier debugging), but that's easy - you can use grunt-concat-sourcemap[2] or a similar plugin for whatever build system you like.

[1]: https://github.com/jrburke/almond

[2]: https://github.com/kozy4324/grunt-concat-sourcemap

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.