{"action":"created","issue":{"url":"https://api.github.com/repos/riot/riot/issues/811","labels_url":"https://api.github.com/repos/riot/riot/issues/811/labels{/name}","comments_url":"https://api.github.com/repos/riot/riot/issues/811/comments","events_url":"https://api.github.com/repos/riot/riot/issues/811/events","html_url":"https://github.com/riot/riot/issues/811","id":85912784,"number":811,"title":"Riot is not require.js compliant","user":{"login":"simoami","id":2038264,"avatar_url":"https://avatars.githubusercontent.com/u/2038264?v=3","gravatar_id":"","url":"https://api.github.com/users/simoami","html_url":"https://github.com/simoami","followers_url":"https://api.github.com/users/simoami/followers","following_url":"https://api.github.com/users/simoami/following{/other_user}","gists_url":"https://api.github.com/users/simoami/gists{/gist_id}","starred_url":"https://api.github.com/users/simoami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simoami/subscriptions","organizations_url":"https://api.github.com/users/simoami/orgs","repos_url":"https://api.github.com/users/simoami/repos","events_url":"https://api.github.com/users/simoami/events{/privacy}","received_events_url":"https://api.github.com/users/simoami/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-07T15:48:50Z","updated_at":"2015-06-07T17:43:12Z","closed_at":null,"body":"There's are 3 issues with require.js compatibility:\r\n\r\n1. In order to be fully require.js compliant, compiled views need to not call `riot.tag()`. remember the riot variable is no longer available in the global namespace.\r\n\r\n2. This point is with regards to browser compilation. r.js will auto append `.js` extension to cdn paths. So https://cdn.jsdelivr.net/g/riot@2.1(riot.min.js+compiler.min.js) becomes https://cdn.jsdelivr.net/g/riot@2.1(riot.min.js+compiler.min.js).js and does not resolve. Here's an example of how jquery cdn is specified:\r\n\r\n```\r\nrequirejs.config({\r\n    paths: {\r\n        jquery: 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min' // <- notice the file extension is not specified\r\n    }\r\n});\r\n```\r\nSee [requirejs documentation](http://www.requirejs.org/docs/api.html#config-shim) for details.\r\n\r\n3 . The compiler.js code itself is non requirejs compliant. It expects riot to be available globally. This is bad for in-browser compilation, since the riot+compile bundle is a mix of compliant and non-compliant require.js code.\r\n\r\nYou'll easily reproduce all of these issues if you set up a very basic requirejs example."},"comment":{"url":"https://api.github.com/repos/riot/riot/issues/comments/109781719","html_url":"https://github.com/riot/riot/issues/811#issuecomment-109781719","issue_url":"https://api.github.com/repos/riot/riot/issues/811","id":109781719,"user":{"login":"simoami","id":2038264,"avatar_url":"https://avatars.githubusercontent.com/u/2038264?v=3","gravatar_id":"","url":"https://api.github.com/users/simoami","html_url":"https://github.com/simoami","followers_url":"https://api.github.com/users/simoami/followers","following_url":"https://api.github.com/users/simoami/following{/other_user}","gists_url":"https://api.github.com/users/simoami/gists{/gist_id}","starred_url":"https://api.github.com/users/simoami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simoami/subscriptions","organizations_url":"https://api.github.com/users/simoami/orgs","repos_url":"https://api.github.com/users/simoami/repos","events_url":"https://api.github.com/users/simoami/events{/privacy}","received_events_url":"https://api.github.com/users/simoami/received_events","type":"User","site_admin":false},"created_at":"2015-06-07T17:43:12Z","updated_at":"2015-06-07T17:43:12Z","body":"@ashleybrener Thanks for the cli flag reference. It looks like it's not working. First off, the documentation refers to `--m` and the command says `-m, --modular`. None of these seem to have any effect on the generated output. Also just an fyi, `riot -v` returns an error:\r\n\r\n```sh\r\n$ riot -v\r\n\r\nmodule.js:340\r\n    throw err;\r\n          ^\r\nError: Cannot find module '../package.json'\r\n    at Function.Module._resolveFilename (module.js:338:15)\r\n    at Function.Module._load (module.js:280:25)\r\n    at Module.require (module.js:364:17)\r\n    at require (module.js:380:17)\r\n    at Object.methods.version (/usr/local/lib/node_modules/riot/lib/server/cli.js:82:9)\r\n    at cli (/usr/local/lib/node_modules/riot/lib/server/cli.js:234:18)\r\n    at Object.<anonymous> (/usr/local/lib/node_modules/riot/lib/server/cli.js:259:8)\r\n    at Module._compile (module.js:456:26)\r\n    at Object.Module._extensions..js (module.js:474:10)\r\n    at Module.load (module.js:356:32)\r\n```\r\n\r\nusing v2.1.0"}}