I'm practicing with Symfony 4 and I am trying to show my images through CSS. Now when I run npm run dev it only compiles the CSS and JS files but not the images. I moved al the images to the /assets/img/ folder.
Now I'm eager to know how I can work with the CSS paths to adapt to the Symfony environment. I only found solutions regarding Symfony 2 and 3 which are not working in this version. My CSS is:
.about-solution-about {
background: url(/img/placeholder.jpg) no-repeat center;
background-size: cover;
width: 540px;
height: 330px;
padding-top: 40px;
}
The image is now in this location: project/assets/img/placeholder.jpg
Somehow I need to access this image in the public folder through the compiled app.css file. I know that the app.css and the app.js files are compiled and placed in the /public/build/ folder.
Now, how do I compile or build all the image assets to the /public/build/ folder and recall those files in my CSS?