Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vue Js 2 include CSS into main index.html

Tags:

webpack

vue.js

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?

like image 700
Alex Avatar asked Feb 19 '17 06:02

Alex


1 Answers

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.

like image 95
Alex Avatar answered Sep 24 '22 22:09

Alex