Skip to content

Fonts not serving from dist : WebPack #1834

Description

@a5hik

angular-cli: local (v1.0.0-beta.11-webpack.2, branch: master)
node: 6.2.1
os: darwin x64

I placed the fonts in "assets/fonts/xxx.woff2" I can see that is placed in the "dist" Dir.

I have the below config in my angular-cli.json file

"apps": [
{
"root": "src",
"outDir": "dist",
"assets": "assets",
"index": "index.html",
"main": "main.ts",
"test": "test.ts",
"tsconfig": "tsconfig.json",
"prefix": "app",
"mobile": false,
"styles": [
"styles.scss"
],
"scripts": [
],
"environments": {
"source": "environments/environment.ts",
"prod": "environments/environment.prod.ts",
"dev": "environments/environment.dev.ts"
}
}`

And I'm referring the fonts like this in my scss..

@font-face { font-family: 'Roboto-Regular'; src: url('/assets/fonts/Roboto-Regular.woff2') format('woff2'); }

However I dont see the fonts loaded in the web page. Wheres the problem ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions