When optimizer used in conjuction together with optimizer-express it's not possible to pass params to optimizer's transformHtml method, only configuration to the optimizer constructor.
Yes, that's a good point. We should change the implementation(s) to also support a function that can be passed via the constructor which will calculate the correct option based on the current page.
When optimizer used in conjuction together with optimizer-express it's not possible to pass params to optimizer's
transformHtml
method, only configuration to the optimizer constructor.And while some transformers honor those configurations: https://github.com/ampproject/amp-toolbox/blob/efe5775c5ff93ebacd6f7bd336ba02d829eca579/packages/optimizer/lib/transformers/AmpBoilerplateTransformer.js#L30-L37
looks like a lot of other does not: https://github.com/ampproject/amp-toolbox/blob/efe5775c5ff93ebacd6f7bd336ba02d829eca579/packages/optimizer/lib/transformers/RewriteAmpUrls.js