vuejs-templates / webpack

A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.
MIT License
9.71k stars 4.4k forks source link

module not found for background image #1491

Open adaksuman opened 5 years ago

adaksuman commented 5 years ago

Hi all,

I have a custom css file which I have placed in assets/css folder. Now inside of this css file, I have referred some images which are placed inside assets/images folder. I did css loading in main.js using require. Like require('./assets/css/custom.css). It does successfully loaded but when I refer a background images in custom.css like background: transparent url('./assets/images/home.png') 50% 50% no-repeat; it fails and says that module is not found.

Could someone please help me what is wrong with this? I did install vue-loader, css-loader and style-loader and project is created with vue-cli.

Also along with this my custom.css file is required throughout my application. What could be best place to put in. Will it be in main.js or App.vue ?

adaksuman commented 5 years ago

error was throwing in my console is These relative modules were not found:

ajaymarathe commented 4 years ago

Same error I have when using gull Theme - * ../../Image/Header_Bg_1.png in ./node_modules/css-loader??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??ref--6-oneOf-3-2!./src/assets/styles/css/themes/lite-purple.min.css