From 688aedd65c761ec28ef37a12c92c091f7591d371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Fri, 13 Oct 2023 10:17:15 +0200 Subject: [PATCH] feat: improve exports for ESM and add shorthand export for the full.pretty build --- core.js | 2 +- full.js | 2 +- full.pretty.js | 3 +++ minimal.js | 2 +- package.json | 20 +++++++++++++++++++- 5 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 full.pretty.js diff --git a/core.js b/core.js index 8be7922e..868a66cd 100644 --- a/core.js +++ b/core.js @@ -1,3 +1,3 @@ 'use strict'; -module.exports = require('./dist/openchemlib-core'); +module.exports = require('./dist/openchemlib-core.js'); diff --git a/full.js b/full.js index 1b2684cc..9911493c 100644 --- a/full.js +++ b/full.js @@ -1,3 +1,3 @@ 'use strict'; -module.exports = require('./dist/openchemlib-full'); +module.exports = require('./dist/openchemlib-full.js'); diff --git a/full.pretty.js b/full.pretty.js new file mode 100644 index 00000000..1cd595b6 --- /dev/null +++ b/full.pretty.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./dist/openchemlib-full.pretty.js'); diff --git a/minimal.js b/minimal.js index 41402481..94aee8d5 100644 --- a/minimal.js +++ b/minimal.js @@ -1,3 +1,3 @@ 'use strict'; -module.exports = require('./dist/openchemlib-minimal'); +module.exports = require('./dist/openchemlib-minimal.js'); diff --git a/package.json b/package.json index c2364565..93296c6c 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,23 @@ "test-only": "jest" }, "main": "./core.js", + "exports": { + ".": "./core.js", + "./minimal": "./minimal.js", + "./minimal.js": "./minimal.js", + "./core": "./core.js", + "./core.js": "./core.js", + "./full": "./full.js", + "./full.js": "./full.js", + "./full.pretty": { + "types": "./full.d.ts", + "default": "./full.pretty.js" + }, + "./full.pretty.js": { + "types": "./full.d.ts", + "default": "./full.pretty.js" + } + }, "files": [ "dist", "types.d.ts", @@ -36,7 +53,8 @@ "core.js", "core.d.ts", "full.js", - "full.d.ts" + "full.d.ts", + "full.pretty.js" ], "repository": { "type": "git",