Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

This is a vite plugin that helps Chrome extensions to refresh automatically when files are modified in development.

Notifications You must be signed in to change notification settings

Jervis2049/vite-plugin-crx-hot-reload

Repository files navigation

Tips

This project is no longer maintained, please follow vite-plugin-crx-mv3.


Introduce

This is a vite plugin that helps Chrome extensions to refresh automatically when files are modified in development.

Install

pnpm install vite-plugin-crx-hot-reload -D

Usage

import crxHotReload from 'vite-plugin-crx-hot-reload'

export default {
  plugins: [crxHotReload(/* plugin options */)]
}

Plugin options

port

  • Type: number
  • Default: 8181

Establish a Socket Connection. Send a message to the Chrome extension client to update when a file changes.

input

  • Type: string
  • Required : true

Manifest file for Chrome extension.

Example:

crxHotReload({
  input: './src/manifest.json'
})

Notes

  • When in a development environment, build.emptyOutDir needs to be set to false in the vite configuration file.
  • After starting the project, if the page does not refresh automatically after modifying content_scripts, you may need to refresh the page manually first.

About

This is a vite plugin that helps Chrome extensions to refresh automatically when files are modified in development.

Resources

Stars

Watchers

Forks

Packages

No packages published