Skip to content

Commit 7c56b84

Browse files
stepankuzmingithub-actions[bot]
authored andcommitted
Backport dynamic import fix for Webpack (internal-12394)
Fix webpack "Critical dependency" warning on dynamic import GitOrigin-RevId: fce9037aad9cdb82eabcf72ec9bcf77e8e785e5b
1 parent b8572e1 commit 7c56b84

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

build/rollup_plugins.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ export const plugins = ({mode, format, minified, production, test, keepClassName
5959
pure_getters: true,
6060
passes: 3
6161
},
62+
format: {
63+
comments: (node, comment) => comment.value.includes('webpackIgnore') || comment.value.includes('vite-ignore'),
64+
},
6265
}) : false,
6366
resolve({
6467
browser: true,

src/source/tile_provider_worker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export async function loadTileProvider(name: string, url: string): Promise<TileP
1717
const pending = pendingLoads.get(name);
1818
if (pending !== undefined) return pending;
1919

20-
const load = import(/* @vite-ignore */ url)
20+
const load = import(/* webpackIgnore: true */ /* @vite-ignore */ url)
2121
.then((mod: {default?: new (...args: unknown[]) => TileProvider<ArrayBuffer>}) => {
2222
const TileProviderClass = mod.default;
2323
if (typeof TileProviderClass !== 'function') {

0 commit comments

Comments
 (0)