Skip to content

Commit 973a6f0

Browse files
committed
Remove external dependencies from bundle
1 parent 055e2ea commit 973a6f0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

packages/autocomplete-client/vite.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ export default defineProject({
2525
// the following code enables Vite in UMD mode to extend the global object with all of
2626
// the exports, and not just a property of it ( https://github.com/vitejs/vite/issues/11624 )
2727
rollupOptions: {
28+
external: ['instant-meilisearch'],
2829
output: {
30+
globals: {
31+
// Map the external 'instant-meilisearch' import to 'instantMeilisearch' global variable,
32+
// i.e. the package name defined in instant-meilisearch's build config
33+
'instant-meilisearch': 'instantMeilisearch'
34+
},
2935
footer: `(function () {
3036
if (typeof self !== "undefined") {
3137
var clonedGlobal = Object.assign({}, self.${globalVarName});

packages/instant-meilisearch/vite.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ export default defineProject({
2525
// the following code enables Vite in UMD mode to extend the global object with all of
2626
// the exports, and not just a property of it ( https://github.com/vitejs/vite/issues/11624 )
2727
rollupOptions: {
28+
external: ['meilisearch'],
2829
output: {
30+
globals: {
31+
'meilisearch': 'meilisearch'
32+
},
2933
footer: `(function () {
3034
if (typeof self !== "undefined") {
3135
var clonedGlobal = Object.assign({}, self.${globalVarName});

0 commit comments

Comments
 (0)