Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

3.1 KB
Raw Blame
@inject IContextAccessor contextAccessor

@{
    var supportRtl = contextAccessor.WorkContext.WorkingLanguage.Rtl;

    <partial name="Partials/ColorScheme"/>

    @*
        `defer` on all three scripts, not just this one: deferred scripts run in document
        order after parsing, so the head bundle keeps executing before app.js mounts #app.
        Deferring only the bundle would invert that and app.js would find no Vue.

        Without it this is a parser-blocking script in <head>, so the browser does not even
        build the DOM for the page body until 399 kB of JavaScript has arrived and run -
        measured at 6.4 s on Slow 4G, against 0.7 s with defer.
    *@
    <script defer asp-location="Head" src="/bundles/app.runtime.bundle.js" asp-append-version="true"></script>
    <link asp-src="/bundles/libs.css" rel="stylesheet" asp-append-version="true">

    <link rel="stylesheet" type="text/css" asp-src="/assets/custom/style.css">

    <environment include="Development">
        @if (supportRtl)
        {
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/common/common.rtl.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/header/header.rtl.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/catalog/catalog.rtl.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/product/product.rtl.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/customer/customer.rtl.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/cart/cart.rtl.css" asp-append-version="true">
        }
        else
        {
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/common/common.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/header/header.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/catalog/catalog.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/product/product.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/customer/customer.css" asp-append-version="true">
            <link rel="stylesheet" type="text/css" asp-src="/theme/css/cart/cart.css" asp-append-version="true">
        }
    </environment>
    <environment include="Production">
        @if (supportRtl)
        {
            <link rel="stylesheet" type="text/css" asp-src="/bundles/style.rtl.min.css" asp-append-version="true">
        }
        else
        {
            <link rel="stylesheet" type="text/css" asp-src="/bundles/style.min.css" asp-append-version="true">
        }
    </environment>

    <partial name="Partials/JsResources"/>
    <script defer asp-location="Footer" asp-src="/theme/script/app.js" asp-order="900" asp-append-version="true"></script>
    <script defer asp-location="Footer" asp-src="/assets/custom/script.js" asp-order="901"></script>
}