spmjs / grunt-cmd-transport

Transport everything into common module.
MIT License
70 stars 32 forks source link

提取依赖时jsParser::getFileInfo路径问题导致无法正常提取依赖 #106

Open zwlijun opened 8 years ago

zwlijun commented 8 years ago

配置如下: conf["transport"] = { "expand": { "options": { "debug": false, "paths": [ doc + src + "js" // /data/wwwroot/htdocs/src/js ] }, "files": [ { "expand": true, "cwd": doc + src + transportTempDir + "/js", // /data/wwwroot/htdocs/src/transport/js "src": "*/.js", "dest": doc + src + transportTempDir + "/js" // /data/wwwroot/htdocs/src/transport/js } ] } };

执行grunt时,无法提取依赖,原因: jsParser#L34::var file = getFileInfo(path.join(process.cwd(), fileObj.src)); 这里join了 process.cwd() 引起的,导致在src前面自动加上了构建工具当前目录。这样子变成了 /data/builder/app/data/wwwroot/htdocs/...

临时解决方案: jsParser#L34::var file = getFileInfo(fileObj.src);