From 169b12ada5e5791f340a881812b12937164cfce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vannicatte?= <20689156+shortcuts@users.noreply.github.com> Date: Fri, 20 Aug 2021 17:38:56 +0200 Subject: [PATCH] fix(rollup): fix umd output (#1298) --- rollup.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 76e16ff93..93c540558 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -81,6 +81,7 @@ packagesConfig.push({ packagesConfig.push({ output: build === 'browser' ? 'algoliasearch' : 'algoliasearch-lite', package: 'algoliasearch', + name: 'algoliasearch', input: `src/builds/${build}.ts`, formats: ['esm-browser'], ignore: ['crypto'], @@ -89,6 +90,7 @@ packagesConfig.push({ packagesConfig.push({ output: build === 'browser' ? 'algoliasearch' : 'algoliasearch-lite', package: 'algoliasearch', + name: 'algoliasearch', input: `src/builds/${build}.ts`, formats: ['umd'], external: ['dom'], @@ -103,12 +105,14 @@ packagesConfig.push( { output: 'recommend', package: 'recommend', + name: '@algolia/recommend', input: `src/builds/browser.ts`, formats: ['esm-browser', 'umd'], }, { output: 'recommend', package: 'recommend', + name: '@algolia/recommend', input: `src/builds/node.ts`, formats: ['cjs'], } @@ -159,7 +163,7 @@ packagesConfig const isEsmBrowserBuild = /\.esm.browser.js$/.test(output.file); if (isUmdBuild) { - output.name = 'algoliasearch'; + output.name = packageConfig.name; output.banner = createLicence(output.file); }