diff --git a/rollup.config.js b/rollup.config.js index bfdba5088b5..eaa2d36c685 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -33,6 +33,11 @@ export default { file: 'dist/index.esm.js', format: 'esm', }, + { + ...commonOutputOptions, + file: 'dist/index.mjs', + format: 'esm', + }, ], }; @@ -65,6 +70,10 @@ function rewritePackageJson(pkg) { newPkg.typescript = { definition: newPkg.typings, }; + newPkg.exports = { + require: newPkg.main, + default: 'index.mjs', + }; return newPkg; }