Gridsome: favicon build to wrong pathPrefix

Created on 25 Feb 2019  路  3Comments  路  Source: gridsome/gridsome

Description

When pathPrefix is set, for instance for building to Github Pages, the favicons are not generated into the correct directory.

Steps to reproduce

Take a starter project, say Gridsome-starter-default. Change pathPrefix in gridsome.config.js. Yarn Build.

Expected result

Favicons should build into the top level of the dist directory

Actual result

Favicons are in a subdirectory of the dist directory, one level lower than the rest of the build

bug

All 3 comments

Also want to point out some anomalies:

  • When I set pathPrefix to "/site-art", the compiled favicons are in "dist/c/"
  • set pathPrefix to "/sitart", compiled to "dist/ets/static/"
  • set pathPrefix to "/gridsome", compiled to "dist/assets/static/"

I don't know why the value of pathPrefix should affect the building process, but probably there is a bad code evaluating the pathPrefix somewhere. I suspect gridsome/lib/webpack/createBaseConfig.js

This is happening with more than just favicons. Any image that I use the <g-image> tag for that would normally be put in the dist/assets/static get put in dist/ssets/static when I use pathPrefix: '/training and all of the *.png files in that folder now have an extension of *.p. and just as @kaceo mentioned different pathPrefixes will get different broken results.

@roborich Yes, it was a bad use of pathPrefix in the image process queue. The commit above does fix the issue. I'll publish it later today.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nuriaheep picture nuriaheep  路  3Comments

upandfine picture upandfine  路  3Comments

tomtev picture tomtev  路  3Comments

MarcoFaul picture MarcoFaul  路  3Comments

maximelebreton picture maximelebreton  路  3Comments