我正在使用mvc core 2我想要捆绑css和js文件 我在wwwroot.when捆绑css中添加css文件不加载网页的CSS plasee看到这张图片路径wwwroot ![path css ][] 布局文件位于区域名称标识中 我试试这个代码 配置inn startup.cs
COLUMN_NAME || COUNTER_COLUMN
<value1> || 1
<value2> || 2
... || ...
<valuen> || n
当bundle为空时,将css链接添加到布局 asmin.min.css
app.UseFileServer();
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(
Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\css\Css-admin")),
RequestPath = new PathString("/Css-admin")
});
app.UseDirectoryBrowser(new DirectoryBrowserOptions
{
FileProvider = new PhysicalFileProvider(
Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\css\Css-admin")),
RequestPath = "/Css-admin"
});
app.UseDirectoryBrowser(new DirectoryBrowserOptions
{
FileProvider = new PhysicalFileProvider(
Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\css\Css-admin\colors")),
RequestPath = "/Css-admin"
});
bundelconfig.json
{
"outputFileName":"wwwroot/css/admin.min.css",
"inputFiles": [
"wwwroot/css/Css-admin/bootstrap.min.css",
"wwwroot/css/Css-admin/custom-bootstrap-rtl.css",
"wwwroot/css/Css-admin/chartist.min.css",
"wwwroot/css/Css-admin/chartist-init.css",
"wwwroot/css/Css-admin/css-chart.css",
"wwwroot/css/Css-admin/style.css",
"wwwroot/css/Css-admin/colors/green.css",
"wwwroot/css/Css-admin/multi-select.css",
"wwwroot/css/Css-admin/bootstrap-datepicker.min.css",
"wwwroot/css/Css-admin/select2.min.css",
"wwwroot/css/Css-admin/bootstrap-select.min.css",
"wwwroot/css/Css-admin/bootstrap-tagsinput.css",
"wwwroot/css/Css-admin/jquery.bootstrap-touchspin.min.css"
],
"minify": {
"enabled": true,
"renameLocals": false,
"adjustRelativePaths": false,
"commentMode": "all"
},
"sourceMap": false
},