optimize-amp.js 454 B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = optimize;
  6. async function optimize(html, config) {
  7. let AmpOptimizer;
  8. try {
  9. AmpOptimizer = require("next/dist/compiled/@ampproject/toolbox-optimizer");
  10. } catch (_) {
  11. return html;
  12. }
  13. const optimizer = AmpOptimizer.create(config);
  14. return optimizer.transformHtml(html, config);
  15. }
  16. //# sourceMappingURL=optimize-amp.js.map