ارتقاء به ASP.NET Core 1.0 - قسمت 21 - بررسی تغییرات Bundling و Minification
نویسنده: وحید نصیری
تاریخ: ۱۳۹۵/۰۵/۰۶ ۱۱:۳۵
آدرس: www.dntips.ir
| مطالب | ۳۶۹۴ |
| نویسندگان | ۲۷۶ |
| گروههای مطالب | ۱۰۲۴ |
| نقشههای راه | ۱۱۹ |
| دورهها | ۱۴ |
| اشتراکها | ۱۷۹۱۴ |
"tools": {
"BundlerMinifier.Core": "2.1.258"
}, No executable found matching command "dotnet-bundle" Version for package `BundlerMinifier.Core` could not be resolved.
[
{
"outputFileName": "wwwroot/css/site.min.css",
"inputFiles": [
"wwwroot/css/site.css"
]
},
{
"outputFileName": "wwwroot/js/site.min.js",
"inputFiles": [
"bower_components/jquery/dist/jquery.min.js",
"bower_components/jquery-validation/dist/jquery.validate.min.js",
"bower_components/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"
],
"minify": {
"enabled": true,
"renameLocals": true
},
"sourceMap": false
}
] "scripts": {
"precompile": [
"dotnet bundle"
],
"prepublish": [
"bower install"
],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
<script src="~/js/site.min.js" asp-append-version="true" type="text/javascript"></script>
"sourceMap": false
"ignoreComments" : true
{
"outputFileName": "out.js",
"inputFiles": [ "in.js" ],
"minify": {
"enabled": true,
"preserveImportantComments": true
}
} {
"outputFileName": "output/bundle.css",
"inputFiles": [
"css/lib/**/*.css", // globbing patterns are supported
"css/input/site.css"
],
"minify": {
"enabled": true,
"commentMode": "all"
}
}, <Project Sdk="Microsoft.NET.Sdk.Web">
<Target Name="PrecompileScript" BeforeTargets="BeforeBuild">
<Exec Command="dotnet bundle" />
</Target>
<ItemGroup>
<DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.2.301" />
</ItemGroup>
</Project> <DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.6.362" />
<Target Name="PrecompileScript" BeforeTargets="BeforeBuild">
<Exec Command="dotnet bundle" />
</Target> dotnet add package BuildBundlerMinifier
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="3.1.0" /> <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.0" /> <PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="3.1.0" />
content[key] = Adjust(config.Content[key].AsString(), input.PhysicalPath, output.Name);
src: url("../webfonts/fa-brands-400.eot"); src: url("../node_modules/components-font-awesome/webfonts/fa-brands-400.eot"); {
"outputFileName": "wwwroot/css/site.min.css",
"inputFiles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/bootstrap-rtl/dist/css/bootstrap-rtl.min.css",
"node_modules/components-font-awesome/css/fa-solid.min.css",
"node_modules/components-font-awesome/css/fontawesome.min.css",
"content/custom.css"
],
"minify": {
"enabled": true,
"renameLocals": false,
"adjustRelativePaths": false
},
"sourceMap": false
}, "wwwroot/lib/jquery/dist/jquery.min.js",
"wwwroot/js/site.min.js" "wwwroot/css/site.min.css"