我正在尝试学习 ASP.NET Core 1.0,并且我正在使用“Web 应用程序”模板创建一个 ASP.NET Core 项目,但我发现与我期望的不一致。我的印象是 npm 和 gulp 作为 documentation 包含在项目中状态:
The template also includes Node Package Manager (npm) and Gulp, making it easier to add bundling and minification to a project.
并且:
When you create a new web project using ASP.NET Core Web Application template, Visual Studio includes the Gulp.js npm package, the gulpfile.js file, and a set of Gulp dependencies.
但是,我没有将 npm 视为包管理选项,也没有看到任何与 npm 或 Gulp 相关的文件。但是,我确实看到了 Bower 选项。
我使用的是 Microsoft .NET Core Tools 1.0.0(预览版 2)。
最佳答案
gulp/grunt/npm 仍受支持,但已从 ASP.NET Core RTM 附带的预览工具中的默认项目模板中删除
我认为您可以手动添加一个 package.json 文件和一个 gulpfile.js 并在 web 应用程序中的 project.json 的脚本部分进行一些编辑,以恢复在 RC2 中的业务
默认模板使用新的 bundler minifier
community standup也有讨论如果你想了解变化背后的原因
关于asp.net - npm 未包含在 ASP.NET Core Web 应用程序中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38230568/