Skip to content

Commit

Permalink
docs: rename browserExtension to webExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 committed Jan 12, 2022
1 parent 44fc874 commit da8a1c7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

```ts
// vite.config.ts
import browserExtension from "vite-plugin-web-extension";
import webExtension from "vite-plugin-web-extension";

export default defineConfig({
plugins: [
browserExtension({
webExtension({
manifest: path.resolve(__dirname, "manifest.json"),
assets: "assets",
}),
Expand Down Expand Up @@ -67,7 +67,7 @@ Here's the minimal setup required:

```ts
// vite.config.ts
import browserExtension from "vite-plugin-web-extension";
import webExtension from "vite-plugin-web-extension";

export default defineConfig({
root: "src",
Expand All @@ -76,9 +76,9 @@ export default defineConfig({
outDir: path.resolve(__dirname, "dist"),
emptyOutDir: true,
},
// Add the browserExtension plugin
// Add the webExtension plugin
plugins: [
browserExtension({
webExtension({
manifest: path.resolve(__dirname, "src/manifest.json"),
assets: "assets",
}),
Expand Down Expand Up @@ -140,7 +140,7 @@ export default defineConfig({
...
plugins: [
vue(),
browserExtension({ ... }),
webExtension({ ... }),
],
});
```
Expand All @@ -167,7 +167,7 @@ import path from "path";
export default defineConfig({
...
plugins: [
browserExtension({
webExtension({
watchFilePaths: [
path.resolve(__dirname, "tailwind.config.js")
]
Expand All @@ -189,7 +189,7 @@ The paths should be relative to the Vite's `root`, just like the `assets` option
```ts
export default defineConfig({
plugins: [
browserExtension({
webExtension({
...
additionalInputs: [
"onboarding/index.html",
Expand Down Expand Up @@ -251,11 +251,11 @@ The `manifest` option also accepts a function. This function should return a jav
Often times this is used to pull in details from your `package.json` like the version so they only have to be maintained in a single place

```ts
import browserExtension from "vite-plugin-web-extension";
import webExtension from "vite-plugin-web-extension";

export default defineConfig({
plugins: [
browserExtension({
webExtension({
manifest: () => {
// Generate your manifest
const packageJson = require("./package.json");
Expand Down Expand Up @@ -308,7 +308,7 @@ cross-env TARGET_BROWSER=chrome vite build
```ts
export default defineConfig({
plugins: [
browserExtension({
webExtension({
manifest: "manifest.json",
assets: "assets",
browser: process.env.TARGET_BROWSER,
Expand All @@ -326,7 +326,7 @@ To disable validation, pass the `skipManifestValidation` option:
```ts
export default defineConfig({
plugins: [
browserExtension({
webExtension({
skipManifestValidation: true,
}),
],
Expand Down

0 comments on commit da8a1c7

Please sign in to comment.