diff --git a/package.json b/package.json index 847fa5d..fbc8e90 100644 --- a/package.json +++ b/package.json @@ -42,12 +42,23 @@ ], "license": "ISC", "main": "index.js", + "module": "index.esm.mjs", + "exports": { + "require": "./index.js", + "import": "./index.esm.mjs" + }, + "files": [ + "index.js", + "index.esm.mjs" + ], "repository": { "type": "git", "url": "https://github.com/ungoldman/changelog-parser.git" }, "scripts": { "release": "gh-release && npm publish", - "test": "standard && node test | tap-spec" + "test": "standard && node test | tap-spec", + "build": "cp index.js index.esm.mjs && sed -i 's/module.exports =/export default/' index.esm.mjs", + "prepublishOnly": "npm build && npm test" } }