I try to create plugin that pre-processes a HTML template (resolving references to CSS/JS, etc) and then converts it into a JS function. For that I created 2 asset types, where the first extends from HTMLAsset so that I don't need to duplicate the HTML parsing logic. I hoped to be able the tweak the type of the generated content, so that it is detected as my other asset, which then can generate the JS.
🐛 bug report
I try to create plugin that pre-processes a HTML template (resolving references to CSS/JS, etc) and then converts it into a JS function. For that I created 2 asset types, where the first extends from HTMLAsset so that I don't need to duplicate the HTML parsing logic. I hoped to be able the tweak the type of the generated content, so that it is detected as my other asset, which then can generate the JS.
The original code is here: https://github.com/adobe/parcel-plugin-htl/pull/19 it used to work with 1.9.7, but it doesn't work as expected against master anymore.
I created some integration tests here: https://github.com/parcel-bundler/parcel/pull/1827
but they fail. it looks like the altered type is not re-inserted into the pipeline again.
🤔 Expected Behavior
The output of the HTLPreAsset should be detected as HTLAsset so that the correct output can be rendered.
😯 Current Behavior
The HTLAsset is never used.