'prebuild' scripts in project.json doesn't run

后端 未结 4 899
长发绾君心
长发绾君心 2021-02-19 10:56

I have a .NET 5 web application using the DNX framework, and I want to run \'npm install\', \'bower install\' and others, whenever I build the project.

Right now I\'m ab

4条回答
  •  星月不相逢
    2021-02-19 11:18

    @Stajs's answer is correct but another step may be needed when working with TypeScript, which seems to be the case here.

    By default, Visual Studio compiles the TypeScript sources before it pipes the build through dnu. So if there are new tsd type definitions or other references that will only work if tsd install is run first, the build will fail. It's a catch 22.

    To prevent Visual Studio from running the TypeScript transpilation, you also have to uncheck the Compile TypeScript on build checkbox on the Properties > Build page.

    Note that this only makes sense if you add TypeScript compilation yourself to your gulp or grunt file.

提交回复
热议问题