From 27a8b0e0654663e31df01e03f5bf34c74ec76e67 Mon Sep 17 00:00:00 2001 From: Jovi De Croock Date: Tue, 19 Mar 2024 07:53:46 +0100 Subject: [PATCH] ensure the cjs export has our async func --- .changeset/clever-kings-brush.md | 5 +++++ config/node-commonjs.js | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/clever-kings-brush.md diff --git a/.changeset/clever-kings-brush.md b/.changeset/clever-kings-brush.md new file mode 100644 index 00000000..be0f9bb2 --- /dev/null +++ b/.changeset/clever-kings-brush.md @@ -0,0 +1,5 @@ +--- +'preact-render-to-string': patch +--- + +Ensure commonjs also has the async export diff --git a/config/node-commonjs.js b/config/node-commonjs.js index c621f570..90090520 100644 --- a/config/node-commonjs.js +++ b/config/node-commonjs.js @@ -12,6 +12,7 @@ fs.copyFileSync(filePath('index.js.map'), filePath('commonjs.js.map')); const source = [ `const mod = require('./commonjs');`, + `mod.default.renderToStringAsync = mod.renderToStringAsync;`, `mod.default.renderToStaticMarkup = mod.default;`, `mod.default.renderToString = mod.default;`, `mod.default.render = mod.default;`,