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: 15/umbraco-cms/customizing/development-flow/vite-package-setup.md
+17-12Lines changed: 17 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,22 +27,22 @@ Before following this guide, read the [Setup Your Development Environment](./) a
27
27
npm create vite@latest
28
28
```
29
29
30
-
This command will help you set up your new package, asking you to pick a framework and a compiler.
30
+
This command will set up your new package and ask you to pick a framework and a compiler.
31
31
32
-
3. Enter `Client` as both the **Project Name** and **Package name** when prompted,
32
+
3. Enter `Client` as both the **Project Name** and **Package name** when prompted.
33
+
34
+
4. Choose **Lit** and **TypeScript** as the framework and language.
33
35
34
36
{% hint style="info" %}
35
-
For following this tutorial, we recommend using the names given above, although you can choose any other you prefer.
37
+
For this tutorial, it is recommended to use the names given above. However, feel free to choose other names if preferred.
36
38
{% endhint %}
37
39
38
-
4. Choose **Lit** and **TypeScript**.
39
-
40
40
<figure><imgsrc="../../extending/customize-backoffice/development-flow/images/vite-project-cli.jpg"alt=""><figcaption><p>Create vite command choices</p></figcaption></figure>
41
41
42
42
This creates a new folder called `Client`, sets up our new project, and creates a `package.json` file, which includes the necessary packages. This is where all your source files live.
43
43
44
44
{% hint style="info" %}
45
-
Alternatively of the two steps above, you can type the following:
45
+
Alternatively, you can skip the interactive prompts and use this command:
This will create a Vite Package with Lit and TypeScript in a folder called **Client**.
52
52
{% endhint %}
53
53
54
-
5. Navigate to the new project folder **Client** and install the packages using:
54
+
5. Navigate to the **Client**project folder and install the required packages:
55
55
56
56
```bash
57
57
npm install
58
58
```
59
59
60
+
Before proceeding, ensure that you install the version of the Backoffice package compatible with your Umbraco installation. You can find the appropriate version on the [@umbraco-cms/backoffice npm page](https://www.npmjs.com/package/@umbraco-cms/backoffice).
61
+
60
62
6. Install the Backoffice package using the following command:
61
63
62
64
```bash
63
65
npm install -D @umbraco-cms/backoffice
64
66
```
65
67
66
68
{% hint style="info" %}
67
-
Optionally you can use `--legacy-peer-deps` in the installation command to avoid installing Umbraco´s sub-dependencies like TinyMCE and Monaco Editor:\
Using this flag will disable Intellisense for external references.
77
+
73
78
7. Open the `tsconfig.json` file.
74
79
8. Add the array `types` inside `compilerOptions`, with the entry of `@umbraco-cms/backoffice/extension-types`:
75
80
@@ -109,7 +114,7 @@ export default defineConfig({
109
114
{% endcode %}
110
115
111
116
{% hint style="info" %}
112
-
The `outDir` parameter specifies where the compiled files will be placed. In this case, it is the `App_Plugins/Client` folder. If you have a different structure such as a Razor Class Library (RCL) project, you should change this path to `wwwroot`.
117
+
The `outDir` parameter specifies where the compiled files are placed. In this example, they are stored in the `App_Plugins/Client` folder. If you are working with a different structure, such as a Razor Class Library (RCL) project, update this path to `wwwroot`.
113
118
{% endhint %}
114
119
115
120
This alters the Vite default output into a **library mode**, where the output is a JavaScript file with the same name as the `name` attribute in `package.json`. The name is `client.js` if you followed this tutorial with no changes.
0 commit comments