From 9e069630e93b5526eb5e5e7d9b74415b4ce4c5e6 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Fri, 29 Oct 2021 00:03:37 +0200 Subject: [PATCH 1/2] feat: prefetch stories on idle browser time --- lib/core-common/src/utils/to-importFn.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/core-common/src/utils/to-importFn.ts b/lib/core-common/src/utils/to-importFn.ts index e49a2cd0c6d7..3f6d45740ef0 100644 --- a/lib/core-common/src/utils/to-importFn.ts +++ b/lib/core-common/src/utils/to-importFn.ts @@ -32,6 +32,8 @@ export function toImportFnPart(specifier: NormalizedStoriesSpecifier) { const pathRemainder = path.substring(${directory.length + 1}); return import( + /* webpackPrefetch: true */ + /* webpackChunkName: "[request]" */ /* webpackInclude: ${webpackIncludeRegexp(specifier)} */ '${directory}/' + pathRemainder ); From 3a4e1560a06e088eab0a1fc39f4b096afad3a030 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Tue, 2 Nov 2021 10:43:46 +0800 Subject: [PATCH 2/2] Remove prefetching --- lib/core-common/src/utils/to-importFn.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/core-common/src/utils/to-importFn.ts b/lib/core-common/src/utils/to-importFn.ts index 3f6d45740ef0..182f62fcf499 100644 --- a/lib/core-common/src/utils/to-importFn.ts +++ b/lib/core-common/src/utils/to-importFn.ts @@ -32,7 +32,6 @@ export function toImportFnPart(specifier: NormalizedStoriesSpecifier) { const pathRemainder = path.substring(${directory.length + 1}); return import( - /* webpackPrefetch: true */ /* webpackChunkName: "[request]" */ /* webpackInclude: ${webpackIncludeRegexp(specifier)} */ '${directory}/' + pathRemainder