{"action":"created","issue":{"url":"https://api.github.com/repos/seajs/seajs/issues/1557","labels_url":"https://api.github.com/repos/seajs/seajs/issues/1557/labels{/name}","comments_url":"https://api.github.com/repos/seajs/seajs/issues/1557/comments","events_url":"https://api.github.com/repos/seajs/seajs/issues/1557/events","html_url":"https://github.com/seajs/seajs/issues/1557","id":95356940,"number":1557,"title":"Build 和 Loader 完全是两回事，不要在本地打包seajs？","user":{"login":"nimojs","id":3949015,"avatar_url":"https://avatars.githubusercontent.com/u/3949015?v=3","gravatar_id":"","url":"https://api.github.com/users/nimojs","html_url":"https://github.com/nimojs","followers_url":"https://api.github.com/users/nimojs/followers","following_url":"https://api.github.com/users/nimojs/following{/other_user}","gists_url":"https://api.github.com/users/nimojs/gists{/gist_id}","starred_url":"https://api.github.com/users/nimojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nimojs/subscriptions","organizations_url":"https://api.github.com/users/nimojs/orgs","repos_url":"https://api.github.com/users/nimojs/repos","events_url":"https://api.github.com/users/nimojs/events{/privacy}","received_events_url":"https://api.github.com/users/nimojs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-16T05:49:12Z","updated_at":"2015-07-16T06:39:19Z","closed_at":null,"body":"**我觉得使用者将seajs 和 spm3没有弄清楚时很容易踩进大坑**，所以开这个 issues 想跟大家一起讨论下本地构建和 seajs 的使用建议。\r\n\r\n官网的介绍一直是\r\n```\r\nA Module Loader for the Web\r\n```\r\n社区一直有打包的需求。官方推荐的打包方式是 spm。\r\n\r\n起初 spm 是为 seajs 服务的，而现在 spm3 已经与seajs \"划清界限\"了。\r\n\r\n> spm3 在本地打包任何前端资源\r\n\r\n> seajs 通过运行时分析依赖加载资源\r\n\r\n\r\n----\r\n\r\n我 seajs 用的很舒服，因为我基于 [seajs-combo](https://github.com/seajs/seajs-combo/issues/3) 让服务器打包js,而不是本地构建。这样只需要维护自己团队的 CMD库 [seajs-cmd](https://github.com/nimojs/seajs-cmd)。对于开发人员来说完全不需要考虑打包的事。\r\n\r\n因为我将 seajs 理解为 **A Module Loader for the Web**。这样做也有缺点，比如并不能做到一个页面只加载一个js,如果存在多级依赖会增加几个 JS请求。\r\n\r\n---\r\n\r\n既然 spm 可以在本地打包任何前端静态资源，那么就用 spm 直接打包。而不将 seajs 与 spm 混用。\r\n\r\nspm 不再是 seajs 配套的构建工具，而是一个静态资源生态环境，类似 NPM 。(其实 spm 的作者们早就在说这一点了)\r\n\r\n---\r\n\r\nseajs 基于 spm 的生态环境获取 cmd 版本的模块，使用 seajs-combo 完成打包。我觉得这是 seajs 最合适的用法。\r\n\r\n如果想做到极致的打包，就只使用 spm 吧。\r\n\r\n\r\n@army8735 @afc163  @sorrycc "},"comment":{"url":"https://api.github.com/repos/seajs/seajs/issues/comments/121847614","html_url":"https://github.com/seajs/seajs/issues/1557#issuecomment-121847614","issue_url":"https://api.github.com/repos/seajs/seajs/issues/1557","id":121847614,"user":{"login":"army8735","id":174904,"avatar_url":"https://avatars.githubusercontent.com/u/174904?v=3","gravatar_id":"","url":"https://api.github.com/users/army8735","html_url":"https://github.com/army8735","followers_url":"https://api.github.com/users/army8735/followers","following_url":"https://api.github.com/users/army8735/following{/other_user}","gists_url":"https://api.github.com/users/army8735/gists{/gist_id}","starred_url":"https://api.github.com/users/army8735/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/army8735/subscriptions","organizations_url":"https://api.github.com/users/army8735/orgs","repos_url":"https://api.github.com/users/army8735/repos","events_url":"https://api.github.com/users/army8735/events{/privacy}","received_events_url":"https://api.github.com/users/army8735/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T06:39:19Z","updated_at":"2015-07-16T06:39:19Z","body":"就是说推荐在本地搞好一切打包的过程。可以脱离seajs。\r\n\r\n如果业务中用到动态加载的话，那么就必须seajs了。"}}