About the packing of webpack?

clipboard.png
this is my file directory

.logo {
background: url ("/ static/img/hospital_logo.png") no-repeat left top;
background-size: 100%;
width: 45px;
height: 45px;
display: inline-block;
margin: 8px 00 10px;
float: left;
}
this is my css background picture path

but these pictures still can"t be displayed after I pack them now, but I can run them locally.

ask God to tell me how to change it so that I can use it

Jan.01,2022

background-image:url ('.') Try writing on the tag


  • make sure that the static directory has been packaged into the . / dist directory, otherwise check the configuration of webpack;
  • the packaged code needs to be viewed on a WEB server, and it is invalid to open it directly;
  • The actual access is different between / static/* and static/* . The former is suitable for domain name access and the latter is suitable for various formats.

assume that the domain name is http://127.0.0.1/, then http://127.0.0.1/static/* can be displayed normally.
but if your domain name is http://127.0.0.1/app/, then http://127.0.0.1/app/static/* access error.

think of three solutions for the time being:

    This problem does not exist when
  • is directly placed on the online server, because online servers are usually top-level (e.g. domain.com ) or second-level domain names (e.g. admin.domain.com );
  • when previewing locally, such as Apache, you can try VirtualHost virtual host configuration;
  • when previewing locally, modify . / dist/index.html , add < base href= "http://127.0.0.1/app/" / > statement, refer to HTML < base > tag ;
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e45f2a-44b67.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e45f2a-44b67.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?