use conditional exports in package json, define package type as module

This commit is contained in:
d98762625 2020-05-22 09:40:42 +01:00
parent 4c3324aea1
commit ce7427b288
2 changed files with 6 additions and 2 deletions

View file

@ -1,5 +1,6 @@
{ {
"name": "cyberchef", "name": "cyberchef",
"type": "module",
"version": "9.20.3", "version": "9.20.3",
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.", "description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
"author": "n1474335 <n1474335@gmail.com>", "author": "n1474335 <n1474335@gmail.com>",
@ -27,8 +28,11 @@
"type": "git", "type": "git",
"url": "https://github.com/gchq/CyberChef/" "url": "https://github.com/gchq/CyberChef/"
}, },
"main": "src/node/cjs.js", "main": "./src/node/wrapper.cjs",
"module": "src/node/index.mjs", "exports": {
"import": "./src/node/index.mjs",
"require": "./src/node/wrapper.cjs"
},
"bugs": "https://github.com/gchq/CyberChef/issues", "bugs": "https://github.com/gchq/CyberChef/issues",
"browserslist": [ "browserslist": [
"Chrome >= 50", "Chrome >= 50",