Skip to content

Commit 4e2582c

Browse files
stepankuzmingithub-actions[bot]
authored andcommitted
Fix webpack "Critical dependency" warning on dynamic import
GitOrigin-RevId: 63a054ae985e12426c7ebe1523f98654404bfabb
1 parent b03fe25 commit 4e2582c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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.ts

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

115-
const load = import(/* @vite-ignore */ url)
115+
const load = import(/* webpackIgnore: true */ /* @vite-ignore */ url)
116116
.catch((err) => {
117117
throw new Error(`TileProvider "${name}" failed to load: ${err instanceof Error ? err.message : String(err)}`);
118118
})

0 commit comments

Comments
 (0)