Alex
Alex

Reputation: 219

Vue Js 2 include CSS into main index.html

I am developing an app first time with VueJS 2 + Webpack And I have created a style.css file that I want to include globaly into index.html file in the root of my app

I have tried loading it from different folders (src, src/assets, root, src, components, node_modules) but as a result i always get 404 error for the specific file.

I have also tried all sorts of paths ../src , /src..., ./src... makes no difference..

What is the correct way to include a style.css file into your project? Where it should be located ? And how should I call it?

Upvotes: 7

Views: 5330

Answers (1)

Alex
Alex

Reputation: 219

I figured out that local css file can be accessed by the main index.html file if it is located in "static" folder of the VueJs project

then just add to the <head> section of your index.html file <link rel="stylesheet" type="text/css" href='static/bootstrap.css'> and you are done.

Upvotes: 11

Related Questions