关于内部版本:如何在AppHarbor中使用RequireJS最小化javascript文件?

How do I minify javascript files using RequireJS in AppHarbor?

在我的发布后构建事件中,我运行node.exe来最小化我的JavaScript文件并将其与RequireJS结合在一起。这将在网站文件夹内创建新文件夹和缩小文件,然后在禁用调试时在HTML中引用这些文件。

node.exe包含在我的源代码管理中,并且可以在本地计算机上正常运行。

在AppHarbor上构建它时,运行

后我立即得到以下错误

1
"node.exe <<PATH TO r.js>> -o <<PATH TO app.build.js>>"

1
2
3
4
fs.js:520
    return binding.lstat(pathModule._makeLong(path));
                   ^
EXEC : error : EPERM, operation not permitted 'D:\\temp'

这是因为我没有在AppHarbor上创建文件夹/文件的权限吗?我将如何解决这个问题并构建缩小的文件?

我不想将缩小的文件预先构建到源代码管理中。


来自AppHarbor常见问题解答:
http://support.appharbor.com/kb/getting-started/frequently-asked-questions

My application cannot write files
By default, applications deployed on AppHarbor can only write to the App_Data folder.
You can enable write access to the entire application directory application settings.
Note that changes (both to App_Data and the rest of the application directory) are not persisted between deploys and you should only use it for caching and other temporary uses.

希望这会有所帮助;)


解决此问题的最佳方法可能是在本地复制AppHarbor构建,并确保一切按预期进行。这是您要运行的:msbuild solution.sln /p:Configuration=Release /property:OutDir=C:\\temp。常见问题解答中还有更多内容:http://support.appharbor.com/kb/getting-started/frequently-asked-questions