src/scss/main.scss
When importing main.scss
, which is an entry point for scss files, it will be successfully converted and loaded via webpack-dev-server
. However, it will be failed compiling when running $ npm run build
due to failure in loading image files.
An example code for importing main.scss
.
import '../scss/main.scss';
Here is an example code for the relative path.
src/scss/components/_colpick-eve.scss
(line 79)
background-image: url('../../../assets/img/red_spuit.png');
When I tried rewriting all the paths from relative to absolute, which is like down below, the build is successfully finished, but web-dev-server fails to load images on the contrary.
background-image: url(`/assets/img/red_spuit.png`);
Is there any way to figure this out ?