在 OS X 上更新 ASP.NET 核心中的缩小 CSS
Update minified CSS in ASP.NET Core on OS X
我有一个基于默认模板的简单 ASP.NET 核心站点。 我需要更新 site.min.css,因为 site.css 已更新。
这是 Jetbrains Rider 中的 OS X。 MSDN 文档说(在 Windows!)简单地重建项目会更新缩小的文件。
bundleconfig.json 文件未更改:
// Configure bundling and minification for the project.
// More info at https://go.microsoft.com/fwlink/?LinkId=808241
[
{
"outputFileName": "wwwroot/css/site.min.css",
// An array of relative input file paths. Globbing patterns supported
"inputFiles": [
"wwwroot/css/site.css"
]
},
{
"outputFileName": "wwwroot/js/site.min.js",
"inputFiles": [
"wwwroot/js/site.js"
],
// Optionally specify minification options
"minify": {
"enabled": true,
"renameLocals": true
},
// Optionally generate .map file
"sourceMap": false
}
]
如何从 IDE 或 CLI(命令行界面)更新缩小的文件?
抱歉耽搁了这么久。我正准备参加会议。要解决您的问题,只需将:<PackageReference Include="BuildBundlerMinifier" Version="2.4.337" />
添加到您的 csproj 文件中。并且您的捆绑文件将在构建后更新。
我有一个基于默认模板的简单 ASP.NET 核心站点。 我需要更新 site.min.css,因为 site.css 已更新。
这是 Jetbrains Rider 中的 OS X。 MSDN 文档说(在 Windows!)简单地重建项目会更新缩小的文件。
bundleconfig.json 文件未更改:
// Configure bundling and minification for the project.
// More info at https://go.microsoft.com/fwlink/?LinkId=808241
[
{
"outputFileName": "wwwroot/css/site.min.css",
// An array of relative input file paths. Globbing patterns supported
"inputFiles": [
"wwwroot/css/site.css"
]
},
{
"outputFileName": "wwwroot/js/site.min.js",
"inputFiles": [
"wwwroot/js/site.js"
],
// Optionally specify minification options
"minify": {
"enabled": true,
"renameLocals": true
},
// Optionally generate .map file
"sourceMap": false
}
]
如何从 IDE 或 CLI(命令行界面)更新缩小的文件?
抱歉耽搁了这么久。我正准备参加会议。要解决您的问题,只需将:<PackageReference Include="BuildBundlerMinifier" Version="2.4.337" />
添加到您的 csproj 文件中。并且您的捆绑文件将在构建后更新。