- The
devHtmlTransform
plugin option has been removed. Vite's dev HTML transform functionality is now required to support HTML files in dev (HMR) mode. In dev mode, a element with the dev server url for the HTML file is injected into the page. This replaces incomplete custom logic for handling resources in HTML files.
- Dev mode HTML transforms are no longer applied by default. Enable via the new devHtmlTransform option if still needed.
- The useDynamicUrlContentScripts option has been renamed to useDynamicUrlWebAccessibleResources
- The webAccessibleScripts option has been removed and replaced by the additionalInputs option. For similar functionality, move scripts to additionalInputs.scripts and html files to additionalInputs.html. Check the README for detailed usage instructions.
-
Upgrade Vite to 4.0.3
- Upgrade any Vite framework plugins
-
The build.modulePreload Vite config option is now defaulted to false by the plugin. Prevent using this default by defining the option in your project's Vite config.
-
Upgrade Vite to 2.9.x
- Upgrade any Vite framework plugins
-
Replace usages of
import.meta.CURRENT_CONTENT_SCRIPT_CSS_URL
withimport.meta.PLUGIN_WEB_EXT_CHUNK_CSS_PATHS
import.meta.PLUGIN_WEB_EXT_CHUNK_CSS_PATHS
is replaced with an array of css paths at build time, so update existing code that expects a single string to properly handle an array of strings.
-
Replace usages of
addStyleTarget
from/@vite/client
withaddViteStyleTarget
from@samrum/vite-plugin-web-extension/client
:const { addStyleTarget } = await import("/@vite/client"); addStyleTarget(shadowRoot);
to
const { addViteStyleTarget } = await import( "@samrum/vite-plugin-web-extension/client" ); await addViteStyleTarget(shadowRoot);
-
If using TypeScript, add plugin client types to your
env.d.ts
file:/// <reference types="@samrum/vite-plugin-web-extension/client" />