Article From:

In JS, by using import to introduce pictures, if the picture is not converted to Base64, the picture will be transferred to the dist/static directory during the packaging process.

import titleImg from './images/title.png';

export default class Login extends Component {
    render() {
        return (<img src={titleImg} alt="The title "/>"}}

But the image path of this time should not be/static/title.ce51fdaf.png,And it should be./static/title.ce51fdaf.png

The site path is

This should be modified in the packaging configuration.

Answer 0:

webpackThe publicPath under output is configured as./xx…

Leave a Reply

Your email address will not be published. Required fields are marked *