Skip to content

Commit

Permalink
docs: 📝 add example usage
Browse files Browse the repository at this point in the history
  • Loading branch information
isaurssaurav committed Sep 24, 2023
1 parent d94377f commit feeaed2
Show file tree
Hide file tree
Showing 26 changed files with 1,682 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
run: npm run semantic-release

18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

> This Vite plugin offers an effortless solution for seamlessly refreshing a Chrome extension built on Manifest V3. With this plugin, you can streamline the development and testing process, ensuring your extension stays up-to-date without manual intervention.
Inspired by [stackoverflow answer](https://stackoverflow.com/a/65485938/7135342) and other similar repo.
Inspired by [stackoverflow answer](https://stackoverflow.com/a/65485938/7135342) and other similar repos.

![demo](https://raw.githubusercontent.com/isaurssaurav/hot-reload-extension-vite/main/demo/demo.png)
![demo](https://raw.githubusercontent.com/isaurssaurav/hot-reload-extension-vite/image.png)

## Usage

Expand Down Expand Up @@ -32,21 +32,23 @@ export default {
Then run

```bash
$ NODE_ENV=development vite build --watch
$ NODE_ENV=development vite build --watch // Override NODE_ENV
```

> Extension will only reload when NODE_ENV is 'development'
## Running example

In progress

## Options

| Options | Type | Description |
| -------------- | ------------------ | --------------------------------------- |
| log | boolean (optional) | Logs error and info. |
| backgroundPath | string(required) | Path to background service worker file. |
| backgroundPath | string (required) | Path to background service worker file. |

## Env variables

| Variable | default | Description |
| ------------------------------ | ------- | --------------- |
| HOT_RELOAD_EXTENSION_VITE_PORT | 8080 | Web socket port |

## License

Expand Down
10 changes: 10 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Demo

## Usage

```bash
$ npm i
$ npm run dev
```

> Load the dist folder chrome browser
18 changes: 18 additions & 0 deletions example/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"manifest_version": 3,
"name": "Hello Extensions",
"description": "Base Level Extension",
"version": "1.0",
"action": {
"default_popup": "src/pages/popup/index.html",
"default_icon": "hello_extensions.png"
},
"devtools_page": "src/pages/dev-tools/index.html",
"content_scripts": [
{
"js": ["src/pages/content/index.js"],
"matches": ["<all_urls>"]
}
],
"background": { "service_worker": "src/pages/background/index.js" }
}
Loading

0 comments on commit feeaed2

Please sign in to comment.