Using vue 2.6.8
I am trying to import a css file into a component.
This is what I have tried, but it is not working.
In main.js just beneath the other imports I added,
require('@/assets/css/agency.css')
In the component,
<style scoped src="@/assets/css/agency.css">
</style>
That is how it is suggested here How to include css files in Vue 2
but I can't get it to work. I get the error
.src/assets/css/agency.css
error: Module not found
I also tried,
<style>
@import './assets/css/agency.css';
</style>
And I tried putting this in main.js,
import './assets/css/agency.css'
Which also does not work.
Been looking at Vue forum too,
https://forum.vuejs.org/t/how-to-import-css-file/14907
Any help would be greatly appreciated.
Thanks,