我有一个使用DNX框架的.NET 5 web应用程序,每当我构建这个项目时,我都想运行'npm install','bower install‘等。
现在我可以在publish上使用'prepublish‘这样做,但它似乎不能与'prebuild’一起工作,尽管我看到它是可能的here
我现在所拥有的:
"scripts": {
"prepublish": [ "npm install", "bower install", "tsd install", "gulp min" ]
}发布于 2015-11-25 18:14:42
发布于 2016-06-20 03:53:30
我知道这个问题有点老生常谈,但谷歌引导我去问它。从2016年6月19日起,您应该使用precompile而不是prebuild。https://docs.microsoft.com/pt-br/dotnet/articles/core/tools/project-json#scripts上提供了project.json文件的新文档。
project.json文件的有效脚本选项为:
微软已经发布了一份声明,声明他们将恢复到旧的.csproj格式。你可以在MSDN blog上读到这篇文章。
这一变化的第一波将发生在Visual Studio“15”RTM中:当在Visual Studio中打开任何.NET核心项目时,它将自动从.xproj转换为.csproj,将资产从project.json文件移动到配置文件和.csproj文件中。我们还将提供一个使用.NET命令行工具转换应用程序的工具。
发布于 2015-11-18 22:40:00
我没有找过beta5,但是DNX有一些关于支持的脚本right here的文档。
基本上是这样的:
{
"scripts": {
"prebuild": "echo before building",
"postbuild": "echo after building",
"prepack": "echo before packing",
"postpack": "echo after packing",
"prerestore": "echo before restoring packages",
"postrestore": "echo after restoring packages"
}
}https://stackoverflow.com/questions/32220663
复制相似问题