Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Usage of webpack public path inconsistent #12

@HoneyryderChuck

Description

@HoneyryderChuck

Related to #5

It seems I might have jumped too early. There is an issue with the option useWebpackPublicPath and its handling in the HtmlWebpackPlugin. First, I'm of the opinion that this option is irrelevant (the manifest.json should always be generated in the output path). Nevertheless, I'd like to go through the inconsistency of its usage right now. So, with following webpack options:

  • path: dist/
  • publicPath: /assets/

as ./dist and with the (default) value of false, it will:

  • generate the manifest.json in the output path: ./dist/manifest.[hash].json
  • inject the link tag <link rel="manifest" href="manifest.[hash].json" />

so, the file is in the proper place, but the url is wrong (it should contain the publicPath from webpack). when I switch it to true (use webpack public path):

  • generates the manifest.json in this path: ./dist/assets/manifest.[hash].json
  • inject the link tag <link rel="manifest" href="/assets/manifest.[hash].json" />

so now the URL is right, but the file isn't in the proper place, therefore the server will return 404.

My feeling is that, somewhere in the codebase, both options are being misused. Nevertheless, I'd remove the useWebpackPublicPath option altogether and just use the right webpack variables.

What do you think?

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