{"action":"created","issue":{"url":"https://api.github.com/repos/fex-team/fis3/issues/87","labels_url":"https://api.github.com/repos/fex-team/fis3/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/fex-team/fis3/issues/87/comments","events_url":"https://api.github.com/repos/fex-team/fis3/issues/87/events","html_url":"https://github.com/fex-team/fis3/issues/87","id":97306148,"number":87,"title":"关于依赖的js和css的顺序","user":{"login":"atmjs","id":12792057,"avatar_url":"https://avatars.githubusercontent.com/u/12792057?v=3","gravatar_id":"","url":"https://api.github.com/users/atmjs","html_url":"https://github.com/atmjs","followers_url":"https://api.github.com/users/atmjs/followers","following_url":"https://api.github.com/users/atmjs/following{/other_user}","gists_url":"https://api.github.com/users/atmjs/gists{/gist_id}","starred_url":"https://api.github.com/users/atmjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atmjs/subscriptions","organizations_url":"https://api.github.com/users/atmjs/orgs","repos_url":"https://api.github.com/users/atmjs/repos","events_url":"https://api.github.com/users/atmjs/events{/privacy}","received_events_url":"https://api.github.com/users/atmjs/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fex-team/fis3/labels/Plugin%20Bug","name":"Plugin Bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-07-26T10:37:40Z","updated_at":"2015-07-30T05:04:50Z","closed_at":null,"body":"```javascript\r\n// account.js代码\r\n/**\r\n * @require reset.css\r\n */\r\nvar $ = require('$');\r\nvar popup = require('popup:1.0.0');\r\n```\r\n构建后代码生成的manifest.json\r\n```javascript\r\n{\r\n  \"res\": {\r\n    \"user/account:1.0.0\": {\r\n      \"uri\": \"/user/account/1.0.0/account.js\",\r\n      \"type\": \"js\",\r\n      \"extras\": {\"moduleId\": \"user/account:1.0.0\"},\r\n      \"deps\": [\r\n        \"$\",\r\n        \"popup:1.0.0\",\r\n        \"reset.css\"\r\n      ]\r\n    }\r\n  },\r\n  \"pkg\": {}\r\n}\r\n```\r\n\r\n其中popup:1.0.0是一个弹窗组件,它依赖一个css,它的依赖在另一个项目里面\r\n```javascript\r\n{\r\n  \"res\": {\r\n    \"popup:1.0.0.css\": {\r\n      \"uri\": \"/lib/popup/1.0.0/popup.css\",\r\n      \"type\": \"css\"\r\n    },\r\n    \"popup:1.0.0\": {\r\n      \"uri\": \"/lib/popup/1.0.0/popup.js\",\r\n      \"type\": \"js\",\r\n      \"extras\": {\"moduleId\": \"popup:1.0.0\"},\r\n      \"deps\": [\r\n        \"$\",\r\n        \"popup:1.0.0.css\"\r\n      ]\r\n    }\r\n  },\r\n  \"pkg\": {}\r\n}\r\n```\r\n\r\n那么综合分析这两个json文件的时候，account.js的依赖就是\r\n[\"$\", \"popup:1.0.0.css\", \"popup:1.0.0\", \"reset.css\"]\r\n这不是我想要的，我想要的是reset.css排列在popup.css的前面\r\n因此我觉得问题出在了生成manifest.json的时候 fis3分析文件中依赖的顺序的时候是先列出js后列出css文件 导致的，因此 我建议不要按文件类型去排列，直接按文件(例子中的account.js)中的依赖的顺序去排列\r\n\r\n问题可能描述的不是太清楚，总之，意思就是\r\n\r\n```javascript\r\n// account.js代码\r\n/**\r\n * @require reset.css\r\n */\r\nvar $ = require('$');\r\nvar popup = require('popup:1.0.0');\r\n\r\n构建后代码生成的manifest.json\r\n```\r\n这段代码，我希望生成的manifest.json应该是这样的：\r\n```\r\n{\r\n  \"res\": {\r\n    \"user/account:1.0.0\": {\r\n      \"uri\": \"/user/account/1.0.0/account.js\",\r\n      \"type\": \"js\",\r\n      \"extras\": {\"moduleId\": \"user/account:1.0.0\"},\r\n      \"deps\": [\r\n        \"reset.css\",\r\n        \"$\",\r\n        \"popup:1.0.0\"\r\n      ]\r\n    }\r\n  },\r\n  \"pkg\": {}\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/fex-team/fis3/issues/comments/126184190","html_url":"https://github.com/fex-team/fis3/issues/87#issuecomment-126184190","issue_url":"https://api.github.com/repos/fex-team/fis3/issues/87","id":126184190,"user":{"login":"xiangshouding","id":631195,"avatar_url":"https://avatars.githubusercontent.com/u/631195?v=3","gravatar_id":"","url":"https://api.github.com/users/xiangshouding","html_url":"https://github.com/xiangshouding","followers_url":"https://api.github.com/users/xiangshouding/followers","following_url":"https://api.github.com/users/xiangshouding/following{/other_user}","gists_url":"https://api.github.com/users/xiangshouding/gists{/gist_id}","starred_url":"https://api.github.com/users/xiangshouding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiangshouding/subscriptions","organizations_url":"https://api.github.com/users/xiangshouding/orgs","repos_url":"https://api.github.com/users/xiangshouding/repos","events_url":"https://api.github.com/users/xiangshouding/events{/privacy}","received_events_url":"https://api.github.com/users/xiangshouding/received_events","type":"User","site_admin":false},"created_at":"2015-07-30T05:04:50Z","updated_at":"2015-07-30T05:04:50Z","body":"@atmjs 对啊，依赖不前置嘛，正常，require.js 应该能处理得了。"}}