Сконфигурируйте Src шрифта Url на основе Serve или Prod Build - PullRequest
0 голосов
/ 08 февраля 2019

Используя Angular 4+ и SCSS,
Мне нужно настроить Font Url Src для выбора из Path на основе метода, который мы запускаем.

Если мы запускаем только в localhost, Когда мы создаем для Serve, Первый URL должен быть выбран
Если мы бежим за Prod, Второй URL должен быть выбран.

Как мне это сделать и где я могу сделать эту конфигурацию

** Код для style.scss **

@font-face
{
    font-family: SFProText;

// This shud be for localhost Serve :   
    src:url('/assets/Fonts/SFPText-Regular.otf') format("opentype");

// This shud be for hosting Production :    
    src:url('/demo/assets/Fonts/SFPText-Regular.otf') format("opentype");
}

@font-face
{
    font-family: SFProText;

// This shud be for localhost Serve :   
    src:url('/assets/Fonts/SFPText-Medium.otf') format("opentype");

// This shud be for hosting Production :
    src:url('/demo/assets/Fonts/SFPText-Medium.otf') format("opentype");
    font-weight: 500;
}
...