8000 HTML template using <img src="path/to/image" /> won't work! · Issue #1557 · jantimon/html-webpack-plugin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
HTML template using <img src="path/to/image" /> won't work! #1557
@tr1s

Description

@tr1s

Expected behaviour

If I do this: <img src="../path/to/image" /> I get a broken image.

I thought this was a webpack 5 bug, so I posted it in their issues list, but they mentioned that this is a html-webpack-plugin bug.

Here is my repo for reference. Just needs an npm i && npm start

Is there something I'm doing wrong? Is this a bug or is there a way to fix this?

Current behaviour

I get this instead of the actual image:

CleanShot 2020-11-10 at 22 21 35@2x

I'm trying with svg, png, and jpg. No luck.

Environment

  • macOS latest 10.15.7
  • node v14.4.0
  • npm v6.14.5
  • webpack v5.4.0
  • html-webpack-plugin v5.0.0-alpha.14

Config

webpack.common.js

Copy your template file if it is part of this issue:

<img
  class="logo-img"
  src="/src/images/mikasa.png"
  alt="website logo"
/>

or any variation of path and/or file extension...!

Relevant Links

Full reproduction repo.

Additional context

Any help would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0