vue-developer-profile icon indicating copy to clipboard operation
vue-developer-profile copied to clipboard

Css not added to head when running develop

Open mRamzii opened this issue 5 years ago • 6 comments

Hello,

First of all thank you for this great template, I have never used Gridsome, and I have to admit, it's nice !

I have a problem where when i run "npm run build", and get my files inside the "dist" folder, the scripts and css are not added in the index.html and the page doesnt look as its supposed to..

I have confirmed that this is the issue since it works when I manually place the

Is there any additionnal step I have missed to "tell gridsome to use css ? "

Thank you

mRamzii avatar Nov 01 '20 21:11 mRamzii

Hi,

What the console output returns when running npm run build ?

YannAries avatar Nov 09 '20 19:11 YannAries

Hello,

Thank you for your response, here is the console output :

$ npm run build

> resume@ build C:\Users\Me\Documents\Developer profile\vue-developer-profile\vue-developer-profile
> gridsome build

Gridsome v0.7.0

Initializing plugins...
Load sources - 0.12s
Create GraphQL schema - 0.05s
Create pages and templates - 0.02s
Generate temporary code - 0.02s
Bootstrap finish - 1.88s
Compile assets - 14.77s
Execute GraphQL (2 queries) - 0s
Write out page data (2 files) - 0s
Render HTML (2 files) - 0.45s
Process files (0 files) - 0s
Process images (14 images) - 1.48s


  Done in 19.25s

The "head" tag in the dist folder doesn't contain any links to css/js..

mRamzii avatar Nov 09 '20 19:11 mRamzii

I had a similar issue with the portfolio images. I fixed it by clearing the cache npm cache clean --force and updating npm to the latest version. npm install -g npm@latest .

Backup your project first and give it a try. Furthermore, make sure to have global css in src/main.js and that the path is well defined.

YannAries avatar Nov 12 '20 00:11 YannAries

Still nothing, for reference, here is how it looks on my browser once I build the project : image

As you can see there are no styles... the <head> tag inside of the index.html is empty..

mRamzii avatar Nov 12 '20 08:11 mRamzii

Something must be missing. Would be good to have further details about your environnement config and how you set up Gridsome and npm for local development.

YannAries avatar Nov 13 '20 21:11 YannAries

npm - 6.14.8 node - v12.18.2

I didnt touch the settings, used it like it was out of the box from the git repo

mRamzii avatar Nov 15 '20 02:11 mRamzii