From 63334ceaef54e45cdfd7b6dae5a0398e683ae726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Gran=C3=A1t?= Date: Mon, 20 Feb 2023 17:05:52 +0100 Subject: [PATCH] fix: type module causing issues with require (#3159) --- packages/web/index.js | 4 ++++ packages/web/package.json | 14 ++++---------- packages/web/rollup.config.js | 4 ---- 3 files changed, 8 insertions(+), 14 deletions(-) create mode 100644 packages/web/index.js diff --git a/packages/web/index.js b/packages/web/index.js new file mode 100644 index 0000000000..d67826cc80 --- /dev/null +++ b/packages/web/index.js @@ -0,0 +1,4 @@ +module.exports = + process.env.NODE_ENV === 'production' + ? require('./dist/tolgee-web.production.cjs.js') + : require('./dist/tolgee-web.development.cjs.js'); diff --git a/packages/web/package.json b/packages/web/package.json index 4f38ed98f7..0892ed114b 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -3,8 +3,7 @@ "version": "5.3.0", "description": "Tolgee for web", "declaration": true, - "main": "./dist/tolgee-web.universal.cjs.js", - "module": "./dist/tolgee-web.universal.esm.js", + "main": "./index.js", "types": "./types/index.d.ts", "type": "module", "exports": { @@ -14,14 +13,9 @@ "import": "./dist/tolgee-web.production.esm.js", "svelte": "./dist/tolgee-web.production.esm.js" }, - "development": { - "require": "./dist/tolgee-web.development.cjs.js", - "import": "./dist/tolgee-web.development.esm.js", - "svelte": "./dist/tolgee-web.development.esm.js" - }, - "require": "./dist/tolgee-web.universal.cjs.js", - "import": "./dist/tolgee-web.universal.esm.js", - "svelte": "./dist/tolgee-web.universal.esm.js", + "require": "./index.js", + "import": "./dist/tolgee-web.development.esm.js", + "svelte": "./dist/tolgee-web.development.esm.js", "types": "./types/index.d.ts" }, "./tools": { diff --git a/packages/web/rollup.config.js b/packages/web/rollup.config.js index 2cce7c5213..4f2eb1284f 100644 --- a/packages/web/rollup.config.js +++ b/packages/web/rollup.config.js @@ -9,10 +9,6 @@ export default [ input: 'src/entry-production.ts', name: 'web.production', }), - buildPackage({ - input: 'src/entry-universal.ts', - name: 'web.universal', - }), // in-context tools buildPackage({