Skip to content

Issue loading @font-face #4

@dayneh88

Description

@dayneh88

Hi,

Having issues trying to get @font-face to work when it's declared in a SASS file. The fonts sit in: assets/src/fonts and the SASS file sits in: assets/src/sass/abstracts/_fonts.scss

I'm declaring my @font-face like this:

@font-face {
  font-family: 'Noigrotesk-Ultra-Light';
  src: url('/assets/src/fonts/noigrotesk-100-normal.woff2') format('woff2'), url('/assets/src/fonts/noigrotesk-100-normal.woff') format('woff');
  font-weight: 100;
}

My console is erroring:

ERROR in ./assets/src/sass/app.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleParseError: Module parse failed: Unexpected character '' (1:4)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

I've seen things like url-loader but I can't find where in the webpack.config.js file where to put it.

Any help would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions