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 4cfbefc
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,27 @@
],
"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:named": "sed -i \"s/const\\ \\(.*\\)\\ =\\ require('\\(.*\\)')\\.\\(.*\\)/import {\\3 as \\1} from '\\2'/g\" index.esm.mjs",
"build:imports:defaults": "sed -i \"s/const\\ \\(.*\\)\\ =\\ require('\\(.*\\)')/import \\1 from '\\2'/g\" index.esm.mjs",
"build:imports": "npm run build:imports:named && npm run build:imports:defaults",
"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 4cfbefc

Please sign in to comment.