Skip to content

Commit

Permalink
feat: export an esm module
Browse files Browse the repository at this point in the history
  • Loading branch information
bumblehead committed Oct 4, 2024
1 parent e0fe1ee commit 88f0335
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,28 @@
],
"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:imports:eol": "sed -i '1s/.*/import { EOL } from \"os\"/' index.esm.mjs",
"build:imports:line-reader": "sed -i '2s/.*/import lineReader from \"line-reader\"/' index.esm.mjs",
"build:imports:removeMarkdown": "sed -i '3s/.*/import removeMarkdown from \"remove-markdown\"/' index.esm.mjs",
"build:imports": "npm run build:imports:eol && npm run build:imports:line-reader && npm run build:imports:removeMarkdown",
"build:exports": "sed -i 's/module.exports =/export default/' index.esm.mjs",
"build": "cp index.js index.esm.mjs && npm run build:imports && npm run build:exports",
"prepublishOnly": "npm build && npm test"
}
}

0 comments on commit 88f0335

Please sign in to comment.