Skip to content

Error Failed to load resource: Couldn't locate the fonts files being used while serving the from the dist directory #1694

@kunal12422

Description

@kunal12422

Hi there,
I noticed that filerev is renaming the font files in assets directory under dist but these changes are not reflected back in dist version of app.css file causing the server to return 404 Not found.

screenshot from 2016-03-09 02 30 46
screenshot from 2016-03-09 02 30 19

Here is config in gruntfile.js

// Renames files for browser caching purposes
filerev: {
dist: {
src: [
'<%= yeoman.dist %>/<%= yeoman.client %>/!(bower_components){,/}.{js,css}',
'<%= yeoman.dist %>/<%= yeoman.client %>/assets/images/{,/}.{png,jpg,jpeg,gif,webp,svg}'
,'<%= yeoman.dist %>/<%= yeoman.client %>/assets/fonts/*'
]
}
},

// Reads HTML for usemin blocks to enable smart builds that automatically
// concat, minify and revision files. Creates configurations in memory so
// additional tasks can operate on them
useminPrepare: {
  html: ['<%= yeoman.client %>/index.html'],
  options: {
    dest: '<%= yeoman.dist %>/<%= yeoman.client %>'
  }
},

// Performs rewrites based on rev and the useminPrepare configuration
usemin: {
  html: ['<%= yeoman.dist %>/<%= yeoman.client %>/{,!(bower_components)/**/}*.html'],
  css: ['<%= yeoman.dist %>/<%= yeoman.client %>/!(bower_components){,*/}*.css'],
  js: ['<%= yeoman.dist %>/<%= yeoman.client %>/!(bower_components){,*/}*.js'],
  options: {
    assetsDirs: [
      '<%= yeoman.dist %>/<%= yeoman.client %>',
      '<%= yeoman.dist %>/<%= yeoman.client %>/assets/images',
      '<%= yeoman.dist %>/<%= yeoman.client %>/assets/'
    ],
    // This is so we update image references in our ng-templates
    patterns: {
      js: [
        [/(assets\/images\/.*?\.(?:gif|jpeg|jpg|png|webp|svg))/gm, 'Update the JS to reference our revved images']
      ]
    }
  }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions