diff --git a/src/AbpCompanyName.AbpProjectName.Core/AbpCompanyName.AbpProjectName.Core.csproj b/src/AbpCompanyName.AbpProjectName.Core/AbpCompanyName.AbpProjectName.Core.csproj index 411e384..ea2f549 100644 --- a/src/AbpCompanyName.AbpProjectName.Core/AbpCompanyName.AbpProjectName.Core.csproj +++ b/src/AbpCompanyName.AbpProjectName.Core/AbpCompanyName.AbpProjectName.Core.csproj @@ -252,6 +252,7 @@ + diff --git a/src/AbpCompanyName.AbpProjectName.Core/Helpers/DebugHelper.cs b/src/AbpCompanyName.AbpProjectName.Core/Helpers/DebugHelper.cs new file mode 100644 index 0000000..144f780 --- /dev/null +++ b/src/AbpCompanyName.AbpProjectName.Core/Helpers/DebugHelper.cs @@ -0,0 +1,17 @@ +namespace AbpCompanyName.AbpProjectName.Helpers +{ + public static class DebugHelper + { + public static bool IsDebug + { + get + { +#if DEBUG + return true; +#else + return false; +#endif + } + } + } +} diff --git a/src/AbpCompanyName.AbpProjectName.WebMpa/AbpCompanyName.AbpProjectName.WebMpa.csproj b/src/AbpCompanyName.AbpProjectName.WebMpa/AbpCompanyName.AbpProjectName.WebMpa.csproj index 77738de..376466d 100644 --- a/src/AbpCompanyName.AbpProjectName.WebMpa/AbpCompanyName.AbpProjectName.WebMpa.csproj +++ b/src/AbpCompanyName.AbpProjectName.WebMpa/AbpCompanyName.AbpProjectName.WebMpa.csproj @@ -573,9 +573,6 @@ - - style.css - @@ -1570,7 +1567,6 @@ - @@ -1632,7 +1628,6 @@ - @@ -2745,7 +2740,7 @@ - + @@ -2806,6 +2801,7 @@ + diff --git a/src/AbpCompanyName.AbpProjectName.WebMpa/App_Start/BundleConfig.cs b/src/AbpCompanyName.AbpProjectName.WebMpa/App_Start/BundleConfig.cs index c650379..172c545 100644 --- a/src/AbpCompanyName.AbpProjectName.WebMpa/App_Start/BundleConfig.cs +++ b/src/AbpCompanyName.AbpProjectName.WebMpa/App_Start/BundleConfig.cs @@ -1,4 +1,5 @@ -using System.Web.Optimization; +using AbpCompanyName.AbpProjectName.Helpers; +using System.Web.Optimization; namespace AbpCompanyName.AbpProjectName.WebMpa { @@ -6,21 +7,22 @@ namespace AbpCompanyName.AbpProjectName.WebMpa { public static void RegisterBundles(BundleCollection bundles) { + BundleTable.EnableOptimizations = !DebugHelper.IsDebug; bundles.IgnoreList.Clear(); bundles.Add( new StyleBundle("~/Bundles/account-vendor/css") - .Include("~/fonts/roboto/roboto.css", new CssRewriteUrlTransform()) - .Include("~/fonts/material-icons/materialicons.css", new CssRewriteUrlTransform()) - .Include("~/lib/bootstrap/dist/css/bootstrap.css", new CssRewriteUrlTransform()) - .Include("~/lib/toastr/toastr.css", new CssRewriteUrlTransform()) - .Include("~/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css", new CssRewriteUrlTransform()) - .Include("~/lib/font-awesome/css/font-awesome.css", new CssRewriteUrlTransform()) - .Include("~/lib/Waves/dist/waves.css", new CssRewriteUrlTransform()) - .Include("~/lib/animate.css/animate.css", new CssRewriteUrlTransform()) - .Include("~/css/materialize.css", new CssRewriteUrlTransform()) - .Include("~/css/style.css", new CssRewriteUrlTransform()) - .Include("~/Views/Account/_Layout.css", new CssRewriteUrlTransform()) + .Include("~/fonts/roboto/roboto.css", new CssRewriteUrlTransformWrapper()) + .Include("~/fonts/material-icons/materialicons.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/bootstrap/dist/css/bootstrap.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/toastr/toastr.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/font-awesome/css/font-awesome.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/Waves/dist/waves.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/animate.css/animate.css", new CssRewriteUrlTransformWrapper()) + .Include("~/css/materialize.css", new CssRewriteUrlTransformWrapper()) + .Include("~/css/style.css", new CssRewriteUrlTransformWrapper()) + .Include("~/Views/Account/_Layout.css", new CssRewriteUrlTransformWrapper()) ); bundles.Add( @@ -53,19 +55,19 @@ namespace AbpCompanyName.AbpProjectName.WebMpa //~/Bundles/vendor/css bundles.Add( new StyleBundle("~/Bundles/vendor/css") - .Include("~/fonts/roboto/roboto.css", new CssRewriteUrlTransform()) - .Include("~/fonts/material-icons/materialicons.css", new CssRewriteUrlTransform()) - .Include("~/lib/bootstrap/dist/css/bootstrap.css", new CssRewriteUrlTransform()) - .Include("~/lib/bootstrap-select/dist/css/bootstrap-select.css", new CssRewriteUrlTransform()) - .Include("~/lib/toastr/toastr.css", new CssRewriteUrlTransform()) - .Include("~/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css", new CssRewriteUrlTransform()) - .Include("~/lib/font-awesome/css/font-awesome.css", new CssRewriteUrlTransform()) - .Include("~/lib/Waves/dist/waves.css", new CssRewriteUrlTransform()) - .Include("~/lib/animate.css/animate.css", new CssRewriteUrlTransform()) - .Include("~/css/materialize.css", new CssRewriteUrlTransform()) - .Include("~/css/style.css", new CssRewriteUrlTransform()) - .Include("~/css/themes/all-themes.css", new CssRewriteUrlTransform()) - .Include("~/Views/Shared/_Layout.css", new CssRewriteUrlTransform()) + .Include("~/fonts/roboto/roboto.css", new CssRewriteUrlTransformWrapper()) + .Include("~/fonts/material-icons/materialicons.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/bootstrap/dist/css/bootstrap.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/bootstrap-select/dist/css/bootstrap-select.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/toastr/toastr.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/font-awesome/css/font-awesome.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/Waves/dist/waves.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/animate.css/animate.css", new CssRewriteUrlTransformWrapper()) + .Include("~/css/materialize.css", new CssRewriteUrlTransformWrapper()) + .Include("~/css/style.css", new CssRewriteUrlTransformWrapper()) + .Include("~/css/themes/all-themes.css", new CssRewriteUrlTransformWrapper()) + .Include("~/Views/Shared/_Layout.css", new CssRewriteUrlTransformWrapper()) ); //~/Bundles/vendor/bottom (Included in the bottom for fast page load) diff --git a/src/AbpCompanyName.AbpProjectName.WebMpa/App_Start/CssRewriteUrlTransformWrapper.cs b/src/AbpCompanyName.AbpProjectName.WebMpa/App_Start/CssRewriteUrlTransformWrapper.cs new file mode 100644 index 0000000..11576cf --- /dev/null +++ b/src/AbpCompanyName.AbpProjectName.WebMpa/App_Start/CssRewriteUrlTransformWrapper.cs @@ -0,0 +1,10 @@ +using System.Web.Optimization; +using System.Web; + +public class CssRewriteUrlTransformWrapper : IItemTransform +{ + public string Process(string includedVirtualPath, string input) + { + return new CssRewriteUrlTransform().Process("~" + VirtualPathUtility.ToAbsolute(includedVirtualPath), input); + } +} \ No newline at end of file diff --git a/src/AbpCompanyName.AbpProjectName.WebMpa/Web.config b/src/AbpCompanyName.AbpProjectName.WebMpa/Web.config index 097305d..9c0d524 100644 --- a/src/AbpCompanyName.AbpProjectName.WebMpa/Web.config +++ b/src/AbpCompanyName.AbpProjectName.WebMpa/Web.config @@ -4,26 +4,26 @@ http://go.microsoft.com/fwlink/?LinkId=301880 --> - - -
- - - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/AbpCompanyName.AbpProjectName.WebMpa/bundleconfig.json b/src/AbpCompanyName.AbpProjectName.WebMpa/bundleconfig.json index 05a4f34..46f8b53 100644 --- a/src/AbpCompanyName.AbpProjectName.WebMpa/bundleconfig.json +++ b/src/AbpCompanyName.AbpProjectName.WebMpa/bundleconfig.json @@ -4,5 +4,17 @@ "inputFiles": [ "css/style.css" ] + }, + { + "outputFileName": "lib/famfamfam-flags/dist/sprite/famfamfam-flags.min.css", + "inputFiles": [ + "lib/famfamfam-flags/dist/sprite/famfamfam-flags.css" + ] + }, + { + "outputFileName": "lib/font-awesome/css/font-awesome.min.css", + "inputFiles": [ + "lib/font-awesome/css/font-awesome.css" + ] } ] diff --git a/src/AbpCompanyName.AbpProjectName.WebMpa/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css b/src/AbpCompanyName.AbpProjectName.WebMpa/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css index 4ebcb31..45556c5 100644 --- a/src/AbpCompanyName.AbpProjectName.WebMpa/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css +++ b/src/AbpCompanyName.AbpProjectName.WebMpa/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css @@ -1,5 +1,5 @@ .famfamfam-flags { - background: url( 'famfamfam-flags.png' ) no-repeat; + background: url('famfamfam-flags.png') no-repeat; background-size: 224px 199px; } diff --git a/src/AbpCompanyName.AbpProjectName.WebSpaAngular/AbpCompanyName.AbpProjectName.WebSpaAngular.csproj b/src/AbpCompanyName.AbpProjectName.WebSpaAngular/AbpCompanyName.AbpProjectName.WebSpaAngular.csproj index d161a6a..d7a43ea 100644 --- a/src/AbpCompanyName.AbpProjectName.WebSpaAngular/AbpCompanyName.AbpProjectName.WebSpaAngular.csproj +++ b/src/AbpCompanyName.AbpProjectName.WebSpaAngular/AbpCompanyName.AbpProjectName.WebSpaAngular.csproj @@ -3626,6 +3626,7 @@ + diff --git a/src/AbpCompanyName.AbpProjectName.WebSpaAngular/App_Start/BundleConfig.cs b/src/AbpCompanyName.AbpProjectName.WebSpaAngular/App_Start/BundleConfig.cs index b8e6656..7d5033d 100644 --- a/src/AbpCompanyName.AbpProjectName.WebSpaAngular/App_Start/BundleConfig.cs +++ b/src/AbpCompanyName.AbpProjectName.WebSpaAngular/App_Start/BundleConfig.cs @@ -1,4 +1,5 @@ -using System.Web.Optimization; +using AbpCompanyName.AbpProjectName.Helpers; +using System.Web.Optimization; namespace AbpCompanyName.AbpProjectName.WebSpaAngular { @@ -6,22 +7,23 @@ namespace AbpCompanyName.AbpProjectName.WebSpaAngular { public static void RegisterBundles(BundleCollection bundles) { + BundleTable.EnableOptimizations = !DebugHelper.IsDebug; bundles.IgnoreList.Clear(); //ACCOUNT BUNDLES bundles.Add( new StyleBundle("~/Bundles/account-vendor/css") - .Include("~/fonts/roboto/roboto.css", new CssRewriteUrlTransform()) - .Include("~/fonts/material-icons/materialicons.css", new CssRewriteUrlTransform()) - .Include("~/lib/bootstrap/dist/css/bootstrap.css", new CssRewriteUrlTransform()) - .Include("~/lib/toastr/toastr.css", new CssRewriteUrlTransform()) - .Include("~/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css", new CssRewriteUrlTransform()) - .Include("~/lib/font-awesome/css/font-awesome.css", new CssRewriteUrlTransform()) - .Include("~/lib/Waves/dist/waves.css", new CssRewriteUrlTransform()) - .Include("~/lib/animate.css/animate.css", new CssRewriteUrlTransform()) - .Include("~/css/materialize.css", new CssRewriteUrlTransform()) - .Include("~/css/style.css", new CssRewriteUrlTransform()) - .Include("~/Views/Account/_Layout.css", new CssRewriteUrlTransform()) + .Include("~/fonts/roboto/roboto.css", new CssRewriteUrlTransformWrapper()) + .Include("~/fonts/material-icons/materialicons.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/bootstrap/dist/css/bootstrap.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/toastr/toastr.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/font-awesome/css/font-awesome.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/Waves/dist/waves.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/animate.css/animate.css", new CssRewriteUrlTransformWrapper()) + .Include("~/css/materialize.css", new CssRewriteUrlTransformWrapper()) + .Include("~/css/style.css", new CssRewriteUrlTransformWrapper()) + .Include("~/Views/Account/_Layout.css", new CssRewriteUrlTransformWrapper()) ); bundles.Add( @@ -54,17 +56,17 @@ namespace AbpCompanyName.AbpProjectName.WebSpaAngular //~/Bundles/App/vendor/css bundles.Add( new StyleBundle("~/Bundles/App/vendor/css") - .Include("~/fonts/roboto/roboto.css", new CssRewriteUrlTransform()) - .Include("~/fonts/material-icons/materialicons.css", new CssRewriteUrlTransform()) - .Include("~/lib/bootstrap/dist/css/bootstrap.css", new CssRewriteUrlTransform()) - .Include("~/lib/toastr/toastr.css", new CssRewriteUrlTransform()) - .Include("~/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css", new CssRewriteUrlTransform()) - .Include("~/lib/font-awesome/css/font-awesome.css", new CssRewriteUrlTransform()) - .Include("~/lib/Waves/dist/waves.css", new CssRewriteUrlTransform()) - .Include("~/lib/animate.css/animate.css", new CssRewriteUrlTransform()) - .Include("~/css/materialize.css", new CssRewriteUrlTransform()) - .Include("~/css/style.css", new CssRewriteUrlTransform()) - .Include("~/css/themes/all-themes.css", new CssRewriteUrlTransform()) + .Include("~/fonts/roboto/roboto.css", new CssRewriteUrlTransformWrapper()) + .Include("~/fonts/material-icons/materialicons.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/bootstrap/dist/css/bootstrap.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/toastr/toastr.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/font-awesome/css/font-awesome.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/Waves/dist/waves.css", new CssRewriteUrlTransformWrapper()) + .Include("~/lib/animate.css/animate.css", new CssRewriteUrlTransformWrapper()) + .Include("~/css/materialize.css", new CssRewriteUrlTransformWrapper()) + .Include("~/css/style.css", new CssRewriteUrlTransformWrapper()) + .Include("~/css/themes/all-themes.css", new CssRewriteUrlTransformWrapper()) ); //~/Bundles/App/vendor/js diff --git a/src/AbpCompanyName.AbpProjectName.WebSpaAngular/App_Start/CssRewriteUrlTransformWrapper.cs b/src/AbpCompanyName.AbpProjectName.WebSpaAngular/App_Start/CssRewriteUrlTransformWrapper.cs new file mode 100644 index 0000000..11576cf --- /dev/null +++ b/src/AbpCompanyName.AbpProjectName.WebSpaAngular/App_Start/CssRewriteUrlTransformWrapper.cs @@ -0,0 +1,10 @@ +using System.Web.Optimization; +using System.Web; + +public class CssRewriteUrlTransformWrapper : IItemTransform +{ + public string Process(string includedVirtualPath, string input) + { + return new CssRewriteUrlTransform().Process("~" + VirtualPathUtility.ToAbsolute(includedVirtualPath), input); + } +} \ No newline at end of file