From 9bd7a73d59b64d52f5511bed7cd46aeb5804c8fb Mon Sep 17 00:00:00 2001 From: Max Franz Date: Tue, 20 Feb 2024 16:44:17 -0500 Subject: [PATCH] Add exports key in package.json Ref: - Improving ESM support and documentation, esp. for browsers #3217 - Change rollup.config to bundle deps in esm.js #3221 --- package.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package.json b/package.json index 4286163e9f..12b30019a9 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,13 @@ "node": ">=0.10" }, "main": "dist/cytoscape.cjs.js", + "module": "dist/cytoscape.esm.js", + "exports": { + ".": { + "import": "./dist/cytoscape.esm.js", + "require": "./dist/cytoscape.cjs.js" + } + }, "unpkg": "dist/cytoscape.min.js", "jsdelivr": "dist/cytoscape.min.js", "scripts": {