icelam / html-inline-script-webpack-plugin

A webpack plugin for converting external script files to inline script block. Requires 'html-webpack-plugin' to work.
https://www.npmjs.com/package/html-inline-script-webpack-plugin
MIT License
55 stars 10 forks source link

fix: unable to match assets when filename contains special characters #385

Closed icelam closed 2 years ago

icelam commented 2 years ago

Description

Attempt to fix issue #353 where the plugin fails to handle file name with special characters like @.

The root cause of the issue is that filename extracted from tag src attribute is a URI encoded string (e.g. 'index%40production.js'), so this PR aims to solve it by adding a decoding step when accessing the assets object from webpack.

How has this been tested?

  1. A new test case where it's configuration has all JavaScript assets output with @ in the filename is added. This is check and run to make sure the output files are properly inlined.

Types of changes

Remarks

N/A