From 5435e055c3664eb84e1f884edf0ff3620e2ea5ff Mon Sep 17 00:00:00 2001 From: KoloMl Date: Fri, 16 Oct 2026 22:39:42 +0200 Subject: [PATCH] Replacing `amd` output format with `cjs` Vite 8 no longer support that. I will have to implement plugin to convert modules into `amd` myself. --- .vite/lib/content-scripts.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.vite/lib/content-scripts.js b/.vite/lib/content-scripts.js index 88baf7b..a4c67d1 100644 --- a/.vite/lib/content-scripts.js +++ b/.vite/lib/content-scripts.js @@ -194,13 +194,10 @@ export async function buildScriptsAndStyles(buildOptions) { dir: buildOptions.outputDir, entryFileNames: '[name].js', chunkFileNames: 'chunks/[name]-[hash].js', - // ManifestV3 doesn't allow to use modern ES modules syntax, so we build all content scripts as AMD modules. - format: "amd", + // Vite 8 no longer have support for `amd` format extension depends on + // TODO Make plugin to live-convert cjs module require/exports into AMD + format: "cjs", inlineDynamicImports: false, - amd: { - // amd-lite requires names even for the entry-point scripts, so we should make sure to add those. - autoId: true, - }, // All these modules are not intended to be used outside of extension anyway minifyInternalExports: true, }