Skip to content

Upgrade to htm-webpack-plugin 4 #8704

Description

@jantimon

Is your proposal related to a problem?

the html-webpack-plugin released a new major yesterday

Please let me know if you need any help to migrate from https://github.com/facebook/create-react-app/blob/d2f813f8897ffcd2f0b0d2da75d0c44924c92f4d/packages/react-scripts/package.json#L55

You could also remove the following option as inject:true has been the default for a long time:

https://github.com/facebook/create-react-app/blob/d2f813f8897ffcd2f0b0d2da75d0c44924c92f4d/packages/react-scripts/config/webpack.config.js#L566

Also the InterpolateHtmlPlugin is now built in an can probably replaced with the html-webpack-plugin templateParameters option as seen in this code sandbox:

https://codesandbox.io/s/html-webpack-plugin--templateparameters-z2j84

    new HtmlWebpackPlugin({
      templateParameters: {
        'PUBLIC_URL': 'demo/value'
<html>
  <head>
    <title><%= htmlWebpackPlugin.options.title %></title>
  </head>
  <body>
    <h1>Hello World</h1>
    <%= PUBLIC_URL %>
  </body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions