Skip to content

Issue loading a font from primeng omega theme roboto-v15-latin #284

Description

@egonzal93

Hi,

I was using the no-universal-support branch as my starter template:

I was using a primeng theme and I have this on my my scss file

@import '~primeng/resources/themes/omega/theme';

Webpack cannot resolve a module I get the following error:

ERROR in .//css-loader!.//sass-loader/lib/loader.js!./src/app/containers/dashboard/style.scss
Module not found: Error: Can't resolve './fonts/roboto-v15-latin-regular.ttf'

Inside of '../../node_modules/primeng/resources/themes/omega/theme.css'

its referencing the font:

/* roboto-regular - latin /
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: url('fonts/roboto-v15-latin-regular.eot'); /
IE9 Compat Modes /
src: local('Roboto'), local('Roboto-Regular'),
url('fonts/roboto-v15-latin-regular.eot?#iefix') format('embedded-opentype'), /
IE6-IE8 /
url('fonts/roboto-v15-latin-regular.woff2') format('woff2'), /
Super Modern Browsers /
url('fonts/roboto-v15-latin-regular.woff') format('woff'), /
Modern Browsers /
url('fonts/roboto-v15-latin-regular.ttf') format('truetype'), /
Safari, Android, iOS /
url('fonts/roboto-v15-latin-regular.svg#Roboto') format('svg'); /
Legacy iOS */
}

My app.components.ts loads the primeng library:
@component({
selector: 'sdm-app',
styleUrls: [
'./material-theme.scss',
'../../node_modules/primeng/resources/primeng.min.css',
'../../node_modules/primeng/resources/themes/omega/theme.css',
'../../node_modules/font-awesome/css/font-awesome.min.css',
'./app.component.scss'],
templateUrl: './app.component.html',
encapsulation: ViewEncapsulation.None
})

Is there something that needs to be added into the webpack.config.ts ?

  {
    test: /\.scss$/,
    loaders: ['to-string-loader', 'css-loader', 'sass-loader']
  },

Thanks,
Jason

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions