{"action":"opened","issue":{"url":"https://api.github.com/repos/fex-team/fis/issues/518","labels_url":"https://api.github.com/repos/fex-team/fis/issues/518/labels{/name}","comments_url":"https://api.github.com/repos/fex-team/fis/issues/518/comments","events_url":"https://api.github.com/repos/fex-team/fis/issues/518/events","html_url":"https://github.com/fex-team/fis/issues/518","id":82799835,"number":518,"title":"关于改进roadmap.domain的建议","user":{"login":"dsonet","id":457552,"avatar_url":"https://avatars.githubusercontent.com/u/457552?v=3","gravatar_id":"","url":"https://api.github.com/users/dsonet","html_url":"https://github.com/dsonet","followers_url":"https://api.github.com/users/dsonet/followers","following_url":"https://api.github.com/users/dsonet/following{/other_user}","gists_url":"https://api.github.com/users/dsonet/gists{/gist_id}","starred_url":"https://api.github.com/users/dsonet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsonet/subscriptions","organizations_url":"https://api.github.com/users/dsonet/orgs","repos_url":"https://api.github.com/users/dsonet/repos","events_url":"https://api.github.com/users/dsonet/events{/privacy}","received_events_url":"https://api.github.com/users/dsonet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-30T12:25:44Z","updated_at":"2015-05-30T12:25:44Z","closed_at":null,"body":"//fis-conf.js\r\n针对roadmap.domain当前的用法是：\r\n//用法一\r\n```\r\nfis.config.merge({\r\n    roadmap : {\r\n        //所有静态资源文件都使用 http://s1.example.com 或者 http://s2.example.com 作为域名\r\n        domain : 'http://s1.example.com, http://s2.example.com'\r\n    }\r\n});\r\n```\r\n//用法二\r\n```\r\nfis.config.merge({\r\n    roadmap : {\r\n        domain : {\r\n            //widget目录下的所有css文件使用 http://css1.example.com 作为域名\r\n            'widget/**.css' : 'http://css1.example.com',\r\n            //所有的js文件使用 http://js1.example.com 或者  http://js2.example.com 作为域名\r\n            '**.js' : ['http://js1.example.com', 'http://js2.example.com']\r\n        }\r\n    }\r\n});\r\n```\r\n上面的key-value方式可以解决部分分组匹配的需求，但是有两个缺陷：\r\n规则间没有优先级\r\n不好写正则\r\n建议能提供如下用法（就是类似path中的处理方式）:\r\n```\r\nfis.config.merge({\r\n    roadmap : {\r\n        //根据匹配规则进行域名前置\r\n        domain : [{reg:'jquery-ui/**.css', url:'http://cdn.jquery-ui.com/'}, {reg:'angular/**js', url:'http://cdn.google.com/angular'}, {reg:/*.*/,url:'http://cdn.self.com'}]\r\n    }\r\n});\r\n```\r\n可以完美适应各种需要。（比如现在最实际的需求就是根据引入的各种lib，mapping到各自的cdn上去）"}}