Closed mizok closed 2 years ago
@mizok
Thank you very much.
This usage was completely unexpected and
I was not able to support it.
The reason why we didn't notice it is because there is no description to test the use with html-webpack-plugin
or html-loader
at this stage.
We will review the test format and change it to be more in line with actual use cases in the future.
However, as we have limited time to work on this issue, for now it will suffice to add the README description and error messages as you have done.
Thank you for everything.
Description
I found that the problem was caused by
query string
.When we parsed the full loader option object to
query string
, it actually parsed every value tostring,
which means there will be noBoolean
type value.check this: https://stackoverflow.com/questions/6461668/boolean-in-a-uri-query
So here my solution is parsing options to
JSON
usingJSON.stringify
, instead of parsing toquery string
(JSON
is also an acceptable type here forwebpack loader inline
).check this: https://webpack.js.org/concepts/loaders/#inline
But unfortunately, both of these two way do NOT support option value in which type is function, which means the
html-loader
option :preprocessor
is not supported here (I not only mentioned this in README.md, but also made a colorful console.log insideindex.ts
in case someone doesn't read the doc)Any suggestion will be appreciated, I am wondering if there will be a better way to fix this issue.
Fixes #19 (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: