Skip to content

Commit 04ac630

Browse files
committed
Put the query parameter back for module importing
1 parent 5685d4d commit 04ac630

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/modules/loader/loaders.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ function wrapImporter<T>(func: (p: string) => Promise<T>) {
2727
2828
For the browser, we use the function constructor to hide the import calls from
2929
webpack so that webpack doesn't try to compile them away.
30-
31-
Browsers automatically cache import() calls, so we add a query parameter with the
32-
current time to always invalidate the cache and handle the memoization ourselves
3330
*/
3431
return async (p: string): Promise<T> => {
3532
try {
@@ -122,7 +119,7 @@ export const memoizedGetModuleDocsAsync = getMemoizedDocsImporter()
122119

123120
const bundleAndTabImporter = wrapImporter<{ default: ModuleBundle }>(
124121
typeof window !== 'undefined' && process.env.NODE_ENV !== 'test'
125-
? (new Function('path', 'return import(path)') as any)
122+
? (new Function('path', 'return import(`${path}?q=${Date.now()}`)') as any)
126123
: // eslint-disable-next-line @typescript-eslint/no-require-imports
127124
p => Promise.resolve(require(p))
128125
)

0 commit comments

Comments
 (0)