You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/docs/commands/build.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,7 +110,7 @@ In this example, the build targets all supported browsers and includes polyfills
110
110
111
111
## Best Practices
112
112
113
-
-**Check Build Logs:** After the build, review the logs to ensure there are no warnings or errors. The build logs will highlight any issues with compatibility or missing assets.
113
+
-**Check Build Logs:** After the build, review the logs to ensure there are no warnings or errors. The build logs will highlight any issues with missing assets.
114
114
-**Optimize Your Manifest:** Ensure that your `manifest.json` is optimized and fully compatible with all targeted browsers to avoid build issues.
115
115
-**Custom Build Artifacts:** You can define custom names for your build artifacts using the `--zip-filename` option, which is useful for organizing builds.
Given a folder or template URL, the `create` command initializes a new extension project in the specified directory applying the chosen template and relevant metadata to the project.
20
+
14
21
## Usage
15
22
16
23
You can run the `create` command using the following syntax.
17
24
Replace `<extension-name|extension-path>` with your project name or path and set any required options:
|`[path or name]`| The extension path or name | If a path is defined, loads the local extension. If a name is provided, loads the extension in the current working directory. |`process.cwd()`|
62
73
| -t, --template | Name of the template used to bootstrap your extension | Bootstrap your extension using a template |[new](../getting-started/templates#template-new)|
74
+
| --install | Whether or not to auto install the template dependencies | Install dependencies and devDependencies during creation time |`true`|
63
75
64
76
-**Path or Name:** If a path is provided, the extension is created at that location. If a name is provided, it is created in the current working directory.
65
77
-**`--template`:** Specifies the template to use when bootstrapping the extension (e.g., `react`, `typescript`).
@@ -78,18 +90,14 @@ This command creates a new extension named my-new-extension using the React temp
78
90
79
91
## Available Templates
80
92
81
-
Users can choose from a variety of templates when creating their extension projects, including:
93
+
<CarouselTemplates />
82
94
83
-
- React: For building new tab or content scripts using React.
84
-
- TypeScript: Initializes an extension with TypeScript support.
85
-
- Custom: You can also specify external templates by providing a URL to a GitHub repo or any npm package.
86
95
87
96
## Best Practices
88
97
89
-
- Use meaningful names: When naming your extension or path, use meaningful names that reflect the project's purpose.
90
-
- Customizing Templates: You can always customize your extension after it's created. For example, if you want to add TypeScript support to a React template, it's easy to do so afterward.
91
98
- Starting from a Template: Using a template is the fastest way to get started with browser extension development in Extension.js.
92
99
93
100
## Next Steps
94
101
95
-
Once your extension is created, you can start developing by running extension dev. For more details on development workflows, check out the Development Guide.
102
+
- Learn how to [develop](/docs/commands/dev) your extension.
103
+
- Use the `extension.config.js` file to [configure your extension](../features/config.mdx).
Copy file name to clipboardExpand all lines: docs/en/docs/commands/dev.mdx
+14-13Lines changed: 14 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,11 @@ import { AvatarImage } from "../../../../theme/components/avatar-image";
7
7
8
8
> **Warning**: This feature is a work in progress and may be incomplete or subject to change. If you see an error or something that could be improved, please make a pull-request. The link that documents this feature can be found at the bottom of the page.
9
9
10
-
11
-
The `dev` command watches for changes in your extension's files, recompiles them, and reloads the extension in real time. If you provide a URL, Extension.js will download and run the extension as if it were local.
10
+
The `dev` command watches for changes in your extension's files, recompiles them, and reloads the extension in real-time. If you provide a URL, Extension.js will download and run the extension as if it were local.
12
11
13
12
## How it Works?
14
13
15
-
For development frameworks, it's an industry-standard practice to have a development server that watches for changes in your files and recompiles them in real-time. Given the complex nature of browser extensions, the `dev` command in Extension.js handles the watch and recompile process for all the different contexts (HTML or not) of your extension.
14
+
For development frameworks, it's an industry-standard practice to have a development server that watches for changes in your files and recompiles them in realtime. Given the complex nature of browser extensions, the `dev` command in Extension.js handles the watch and recompile process for all the different contexts (HTML or not) of your extension.
16
15
17
16
The `dev` command also provides a way to run remote extensions by providing a URL. This is useful when you want to test an extension from source without having to clone the repository.
18
17
@@ -47,14 +46,16 @@ In this example, the extension is developed in the `path/to/my-extension` direct
47
46
48
47
Below is a breakdown of the available flags for the `dev` command:
|[path or url]| The extension path or the remote extension URL | If a path is defined, it loads the local extension. If a URL is provided, it pulls the extension from a remote source and loads it as a local extension |`process.cwd()`|
53
-
| -b, --browser | The browser that will run the extension | Changes the browser (`chrome`, `edge`, `firefox`, `all`) |`"chrome"`|
54
-
| --chromium-binary | The path to the Chromium binary | The path to the Chromium binary. This is useful when you want to run the extension with Chromium-based browsers not supported by Extension.js. [Read how](../browsers/unsupported.mdx)|`undefined`|
55
-
| --gecko-binary | The path to the Gecko binary | The path to the Gecko binary. This is useful when you want to run the extension with Firefox-based browsers not supported by Extension.js. . [Read how](../browsers/unsupported.mdx)|`undefined`|
56
-
| -o, --open | True or false | Opens the browser when the extension is ready |`true`|
57
-
| --polyfill | True or false | Allow the `browser.*` API namespace to run with all Chromium-based browsers**.**|`false`|
|`[path or url]`| Extension path or remote URL | If a path is defined, it loads the local extension. If a URL is provided, it pulls the extension from a remote source and loads it as a local extension |`process.cwd()`|
52
+
|`--polyfill`| Boolean | Enables compatibility for the `browser.*` API in Chromium-based browsers |`false`|
53
+
|`--profile`| Profile path | Specifies a path to a browser profile for testing |`default`|
54
+
|`-b, --browser`| Browser to run the extension | Specifies the browser to run (`chrome`, `edge`, `firefox`, `all`) |`"chrome"`|
55
+
|`--chromium-binary`| Path to the Chromium binary | Provides the path to a custom Chromium-based browser binary [Read more](../browsers/unsupported.mdx)|`undefined`|
56
+
|`--gecko-binary`| Path to the Gecko binary | Provides the path to a custom Gecko-based browser binary [Read more](../browsers/unsupported.mdx)|`undefined`|
57
+
|`--starting-url`| URL | Starting URL for testing with the extension |`chrome://newtab`|
58
+
|`--open`| Boolean | Whether or not to automatically open the browser upon starting dev |`true`|
58
59
59
60
## Examples
60
61
@@ -120,8 +121,8 @@ Below is a breakdown of the available flags for the `dev` command:
120
121
121
122
## Best Practices
122
123
123
-
-**Browser Specific Configurations:**You can use the `--browser` flag to run your extension in different browsers during the development process.
124
-
-**Remote Extensions:**Test them with the `--browser` flag to test your extension in different browsers without having to clone the repository.
124
+
-**Browser Compatibility:**Test your extension in different browsers to ensure compatibility with the target audience.
125
+
-**Polyfilling:**If Firefox or a Gecko-based browser is also a target, use the `--polyfill` flag to enable compatibility for the `browser.*` API in Chromium-based browsers.
|[path or url]| The extension path or the remote extension URL | If a path is defined, previews the local extension. If a URL is provided, pulls the extension from remote source and previews it as a local extension |`process.cwd()`|
46
-
| -b, --browser | The browser that will run the extension | Specifies the browser (`chrome`, `edge`, `all`) |`"chrome"`|
46
+
|`--profile`| Profile path | Specifies a path to a browser profile for testing |`default`|
47
+
|`-b, --browser`| Browser to run the extension | Specifies the browser to run (`chrome`, `edge`, `firefox`, `all`) |`"chrome"`|
48
+
|`--chromium-binary`| Path to the Chromium binary | Provides the path to a custom Chromium-based browser binary [Read more](../browsers/unsupported.mdx)|`undefined`|
49
+
|`--gecko-binary`| Path to the Gecko binary | Provides the path to a custom Gecko-based browser binary [Read more](../browsers/unsupported.mdx)|`undefined`|
50
+
|`--starting-url`| URL | Starting URL for testing with the extension |`chrome://newtab`|
0 commit comments