{"action":"created","issue":{"url":"https://api.github.com/repos/fex-team/fis-parser-sass/issues/24","labels_url":"https://api.github.com/repos/fex-team/fis-parser-sass/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/fex-team/fis-parser-sass/issues/24/comments","events_url":"https://api.github.com/repos/fex-team/fis-parser-sass/issues/24/events","html_url":"https://github.com/fex-team/fis-parser-sass/issues/24","id":77279645,"number":24,"title":"输出目录设置问题？","user":{"login":"calledT","id":2672969,"avatar_url":"https://avatars.githubusercontent.com/u/2672969?v=3","gravatar_id":"","url":"https://api.github.com/users/calledT","html_url":"https://github.com/calledT","followers_url":"https://api.github.com/users/calledT/followers","following_url":"https://api.github.com/users/calledT/following{/other_user}","gists_url":"https://api.github.com/users/calledT/gists{/gist_id}","starred_url":"https://api.github.com/users/calledT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calledT/subscriptions","organizations_url":"https://api.github.com/users/calledT/orgs","repos_url":"https://api.github.com/users/calledT/repos","events_url":"https://api.github.com/users/calledT/events{/privacy}","received_events_url":"https://api.github.com/users/calledT/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-17T10:45:51Z","updated_at":"2015-05-17T11:55:50Z","closed_at":null,"body":"我想把目录结构为\r\n```shell\r\n└── scss\r\n    └── common.scss\r\n```\r\n的内容输出为\r\n```shell\r\n└── css\r\n    └── common.css\r\n```\r\n\r\n想下面这样设置\r\n```js\r\nfis.config.set('settings.parser.sass', {\r\n    include_paths: [],\r\n    output: 'css/'\r\n});\r\n```\r\n\r\n输出结果变成了\r\n```shell\r\n└── css\r\n    └── scss\r\n        └── common.css\r\n```\r\n\r\n正确的配置应该是怎样的呢？"},"comment":{"url":"https://api.github.com/repos/fex-team/fis-parser-sass/issues/comments/102790681","html_url":"https://github.com/fex-team/fis-parser-sass/issues/24#issuecomment-102790681","issue_url":"https://api.github.com/repos/fex-team/fis-parser-sass/issues/24","id":102790681,"user":{"login":"fouber","id":536297,"avatar_url":"https://avatars.githubusercontent.com/u/536297?v=3","gravatar_id":"","url":"https://api.github.com/users/fouber","html_url":"https://github.com/fouber","followers_url":"https://api.github.com/users/fouber/followers","following_url":"https://api.github.com/users/fouber/following{/other_user}","gists_url":"https://api.github.com/users/fouber/gists{/gist_id}","starred_url":"https://api.github.com/users/fouber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fouber/subscriptions","organizations_url":"https://api.github.com/users/fouber/orgs","repos_url":"https://api.github.com/users/fouber/repos","events_url":"https://api.github.com/users/fouber/events{/privacy}","received_events_url":"https://api.github.com/users/fouber/received_events","type":"User","site_admin":false},"created_at":"2015-05-17T11:55:50Z","updated_at":"2015-05-17T11:55:50Z","body":"@calledT\r\n\r\nfis最开始设计工具的时候，发现不应该让插件自己决定怎么输出，否则这个插件输出到output，那个插件输出到dist，这个插件有A规范，那个插件有B规范，就不能得到一致的架构设计了。\r\n\r\n所以，fis规定：\r\n\r\n> 插件只处理内容，fis负责确定发布路径。\r\n\r\n于是，我们设计了一种配置，叫 ``roadmap.path`` ，负责给每个文件分配属性，而这些属性决定了fis对每个文件的处理方式。比如一个文件的 ``release`` ，那么这个文件就不会被发布，如果如果文件的 ``release`` 属性是 '/css/common.css' 那它就会被发布到这个目录下。所以，你的需求在fis中的配置为：\r\n\r\n```js\r\nfis.config.set('roadmap.path', [\r\n    {\r\n        reg: /^\\/scss\\/(.*\\.scss)$/,\r\n        release: 'css/$1'\r\n    }\r\n]);\r\n```\r\n\r\nfis中，给文件分配属性是通过roadmap.path中的 reg 匹配来实现的，reg命中的文件路径，就把reg之外的其他属性都赋值给文件对象。\r\n\r\n所以，上面这个配置就是命中了scss下的所有.scss后缀的文件，并且把匹配到的文件路径中scss后面的部分取出来用 ``$1`` 表示（这是正则分组，如果不了解，可以看一下js的正则表达式介绍），用这个值来设置文件的release属性\r\n\r\n这样，fis在发布项目的时候，就知道该怎么发布文件了。接下来，如果你希望整个项目发布到d盘的output目录下作为最终发布路径，那么就执行命令：\r\n\r\n```bash\r\nfis release -d d:\\output\r\n```\r\n然后，你的这个``scss/common.scss``由于配置了release属性是“css/common.css”，那么在这条命令执行后，它的实际产出路径就是 ``d:\\output\\css\\common.css``"}}