asp.net - npm 未包含在 ASP.NET Core Web 应用程序中

标签 asp.net asp.net-core asp.net-core-mvc

我正在尝试学习 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/

相关文章:

asp.net-core-mvc - Blazor 和 ASP.NET Core 3.0 MVC

c# - asp 中的消息框弹出,javascript 无法识别?

c# - 系统参数异常 : Parameter is not valid

html - 使用提交按钮传递附加数据

c# - 在 Controller asp.net-core v1.1.0 之外使用 Dependency Injection 进行应用程序设置

c# - 如何在 ASP.NET MVC 6 (ASP.NET Core) 中获取 returnUrl AccessDeniedPath

c# - LINQ to SQL 在 DataContext Dispose 之后使用查询

javascript - 如何在 JavaScript 中删除 GridView 中的所有行?

azure - 未找到 react 组件

download - 如何将模型下载为 JSON 文件?