From 2ad099bf7e20da74f4ee7c6113322cfe470f5d90 Mon Sep 17 00:00:00 2001 From: Aaron Klinker Date: Wed, 27 Dec 2023 12:32:59 -0600 Subject: [PATCH] docs: General fixes and improvements --- docs/guide/configuration.md | 22 ++++++++++------------ docs/guide/manifest.md | 8 +++++++- docs/guide/publishing.md | 2 +- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/docs/guide/configuration.md b/docs/guide/configuration.md index 7bb42a473..695cf7f5a 100644 --- a/docs/guide/configuration.md +++ b/docs/guide/configuration.md @@ -51,12 +51,6 @@ export default defineConfig({ }); ``` -## Vite Config - -[Vite](https://vitejs.dev/) is the bundler used to build each entrypoint of your extension. Vite can be configured via the `vite` option. - -See [Vite's documentation](https://vitejs.dev/config/) for configuring the bundler. - ## Frontend Frameworks Adding a framework like Vue, React, or Svelte is easy! @@ -70,9 +64,9 @@ import { defineConfig } from 'wxt'; import vue from '@vitejs/plugin-vue'; export default defineConfig({ - vite: { + vite: () => ({ plugins: [vue()], - }, + }), }); ``` @@ -81,9 +75,9 @@ import { defineConfig } from 'wxt'; import react from '@vitejs/plugin-react'; export default defineConfig({ - vite: { + vite: () => ({ plugins: [react()], - }, + }), }); ``` @@ -92,10 +86,14 @@ import { defineConfig } from 'wxt'; import { svelte } from '@sveltejs/vite-plugin-svelte'; export default defineConfig({ - vite: { + vite: () => ({ plugins: [svelte()], - }, + }), }); ``` ::: + +:::info +Internally, WXT runs `vite build` multiple times during a single build. It can't share the same instance of some plugins between each build, so a function is used to return completely new instances of each plugin for each build. +::: diff --git a/docs/guide/manifest.md b/docs/guide/manifest.md index 3924aedfa..8d04f432f 100644 --- a/docs/guide/manifest.md +++ b/docs/guide/manifest.md @@ -1,12 +1,13 @@ # Manifest.json -The manifest.json is generated at build-time based on files in your `entrypoints` directory and your `wxt.config.ts`. +The manifest.json is generated at build-time based on files in the `entrypoints/` directory and `wxt.config.ts`. ## Configuration While entrypoints are generated and added to the manifest at build-time, you can customize or add to your `manifest.json` in the config file. ```ts +// wxt.config.tsentrypoint of your extension import { defineConfig } from 'wxt'; export default defineConfig({ @@ -118,3 +119,8 @@ export default defineConfig({ }, }); ``` + +See the official localization examples for more details: + +- [I18n](https://github.com/wxt-dev/wxt-examples/tree/main/examples/vanilla-i18n#readme) +- [Vue I18n](https://github.com/wxt-dev/wxt-examples/tree/main/examples/vue-i18n#readme) diff --git a/docs/guide/publishing.md b/docs/guide/publishing.md index 23603264a..3d6a77335 100644 --- a/docs/guide/publishing.md +++ b/docs/guide/publishing.md @@ -4,7 +4,7 @@ WXT offers several utilities that simplify the publishing process. ## First Time Publishing -If you're publishing an extension to a store for the first time, it's recommended that you manually navigate the process. Each store has unique steps and requirements that you need to familiarize yourself with. +If you're publishing an extension to a store for the first time, you must manually navigate the process. Each store has unique steps and requirements that you need to familiarize yourself with. Each store requires that a ZIP file be uploaded. You can generate these using the `wxt zip` command: