From a74cd701818266366216b6ee7603c4f006ca9261 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Thu, 14 Jul 2022 15:00:17 -0400 Subject: [PATCH] Default hoistTransitiveImports to false --- packages/addon-dev/src/rollup.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/addon-dev/src/rollup.ts b/packages/addon-dev/src/rollup.ts index 770d3b30b..1816d481b 100644 --- a/packages/addon-dev/src/rollup.ts +++ b/packages/addon-dev/src/rollup.ts @@ -65,8 +65,18 @@ export class Addon { // emitting ES modules, in your `destDir`, and their filenames are equal to // their bundle names (the bundle names get generated by `publicEntrypoints` // above). + // + // hoistTransitiveImports is disabled because the purpose of hoisting transitive imports + // is to improve performance of apps loading modules. + // Since v2 addons do not know exactly how they'll be used, this performance decision + // is left up to apps. output() { - return { dir: this.#destDir, format: 'es', entryFileNames: '[name]' }; + return { + dir: this.#destDir, + format: 'es', + entryFileNames: '[name]', + hoistTransitiveImports: false, + }; } dependencies() {