question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

why I update html-webpack-include-assets-plugin to 1.0.9, include assets will be append several times

See original GitHub issue

hello, @jaridmargolin ,In the previous version, html-webpack-include-assets-plugin@1.0.7, everything works fine. My colleague update the plugin, I see some errors. include assets will be append several times. this is code:

new HtmlWebpackIncludeAssetsPlugin({
    assets: ['css/no-public-path.min.css', 
                  'scripts/libraries/vendor.js',
                  'scripts/libraries/vendor2.js'],
    append: false,
  })

append the following into the index template html like this

<head>
  <link rel="icon" href="css/no-public-path.min.css"/>
  <link rel="icon" href="css/no-public-path.min.css"/>
  <link rel="icon" href="css/no-public-path.min.css"/>
</head>
<body>
  <script type="text/javascript" src="scripts/libraries/vendor.js"></script>
  <script type="text/javascript" src="scripts/libraries/vendor2.js"></script>
  <script type="text/javascript" src="scripts/libraries/vendor.js"></script>
  <script type="text/javascript" src="scripts/libraries/vendor2.js"></script>
  <script type="text/javascript" src="scripts/libraries/vendor.js"></script>
  <script type="text/javascript" src="scripts/libraries/vendor2.js"></script>
</body>

should I use html-webpack-tags-plugin replace html-webpack-include-assets-plugin, they are the same plugin or different

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jharris4commented, Nov 22, 2019

@sailormillet it’s quite difficult to help debug your issues without seeing a more complete webpack config. Without more detail, the only things I can suggest are:

  • try upgrading to html-webpack-tags-plugin
  • for multi page applications, you probably want to use the files option so the plugin only gets applied once for each single html file.
0reactions
the-simiancommented, May 14, 2020

I experienced this exact issue when using dependencies that used the older html-webpack-include-assets-plugin. upgrading to the tags version fixed it for me, but a lot of plugins out there still use the old one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · SimenB/add-asset-html-webpack-plugin - GitHub
Add a JavaScript or CSS asset to the HTML generated by html-webpack-plugin - Issues · SimenB/add-asset-html-webpack-plugin.
Read more >
Multiple html files using webpack - Stack Overflow
A basic approach for handling html pages is using the html-webpack-plugin which not only can copy html files but also has an extensive...
Read more >
html-webpack-include-assets-plugin | Yarn - Package Manager
The assetPath property may be used to specify the full path to the included asset. This can be useful as it will trigger...
Read more >
add-asset-html-webpack-plugin - npm
Add a JS or CSS assets to a generated HTML file. ... Start using add-asset-html-webpack-plugin in your project by running `npm i ...
Read more >
How I solved and debugged my Webpack issue through trial ...
I knew that Webpack was not easy to configure: there are many parts ... I created everything so that I could start coding...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found