Skip to content

Commit

Permalink
Support Node ESModule (#1329)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkisiela committed Apr 2, 2020
1 parent 1c00613 commit acff414
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rollup.config.js
Expand Up @@ -33,6 +33,11 @@ export default {
file: 'dist/index.esm.js',
format: 'esm',
},
{
...commonOutputOptions,
file: 'dist/index.mjs',
format: 'esm',
},
],
};

Expand Down Expand Up @@ -65,6 +70,10 @@ function rewritePackageJson(pkg) {
newPkg.typescript = {
definition: newPkg.typings,
};
newPkg.exports = {
require: newPkg.main,
default: 'index.mjs',
};

return newPkg;
}

0 comments on commit acff414

Please sign in to comment.