Hacker News new | ask | show | jobs
by rgarcia 5243 days ago
You can define a requirejs module that just consists of data: http://requirejs.org/docs/api.html#defsimple. Then in your app incantation (main.js for requirejs stuff), load this module and pass it to your app instance.

If you feel weird about loading data as a js file, there is also a requirejs plugin for loading raw json files as a module: https://github.com/millermedeiros/requirejs-plugins