fix: disable modulePreload polyfill for Chrome MV3 compatibility
CI / test (pull_request) Successful in 18s
CI / test (pull_request) Successful in 18s
Vite was injecting modulepreload-polyfill.js into the built output, which Chrome rejected at runtime with: 'A preload for .../modulepreload-polyfill.js is found, but is not used because it is a cross-world extension resource mismatch.' Disabling the polyfill (extension context does not need it — Chrome 110+ supports bare ESM natively) removes the offending chunk entirely.
This commit is contained in:
1 parent
8794218ee8
commit
88585a29bf
1 file changed
+4
@@ -49,8 +49,12 @@ export default defineConfig({
|
||||
},
|
||||
],
|
||||
build: {
|
||||
target: 'chrome110',
|
||||
outDir: '../dist',
|
||||
emptyOutDir: true,
|
||||
modulePreload: {
|
||||
polyfill: false,
|
||||
},
|
||||
rollupOptions: {
|
||||
input: {
|
||||
background: resolve(__dirname, 'src/background/background.js'),
|
||||
|
||||
Reference in new issue
Block a user