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
For Windows environments the command should be slightly different::
50
+
51
+
```typescript
52
+
npmcreatevite@latestclient-----templatelit-ts
53
+
```
54
+
55
+
or you will still see the interactive prompts, especially when using PowerShell.
56
+
57
+
{% endhint %}
58
+
49
59
4. Navigate into the new **client** folder and install the packages:
50
60
51
61
```bash
@@ -146,7 +156,7 @@ Run `npm run watch` in the terminal.
146
156
147
157
## Umbraco Package declaration
148
158
149
-
Declare your package to Umbraco via a file called `umbraco-package.json`. This should be added at the root of your package. The `umbraco-package.json` file should be located at `/App_Plugins/` or `/App_Plugins/{YourPackageName}` for Umbraco to detect it.
159
+
Declare your package to Umbraco via a file called `umbraco-package.json`. This should be added in the `public` folder under the root of your package. Once built the `umbraco-package.json` file should be located at `/App_Plugins/` or `/App_Plugins/{YourPackageName}` for Umbraco to detect it.
150
160
151
161
This example declares a Dashboard as part of your Package, using the Vite example element.
Copy file name to clipboardExpand all lines: 15/umbraco-cms/tutorials/creating-a-custom-dashboard/README.md
+20-4
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ At each step, you will find a dropdown for `welcome-dashboard.element.ts`, `and
51
51
## Setting up a package
52
52
53
53
1. Follow the [Vite Package Setup](../../customizing/development-flow/vite-package-setup.md) by creating a new project folder called "`welcome-dashboard`" in `App_Plugins`.
54
-
2. Create a manifest file named `umbraco-package.json` at the root of the `welcome-dashboard` folder. Here we define and configure our dashboard.
54
+
2. Create a manifest file named `umbraco-package.json`within the `public` folder, located at the root of the `welcome-dashboard` folder. Here we define and configure our dashboard.
55
55
3. Add the following code to `umbraco-package.json`:
3. In the `vite.config.ts` file replace the `entry` to our newly created `.ts` file:
143
+
3. In the `vite.config.ts` file update the `entry` to point to our newly created `.ts` file, and also ensure that the `outDir` and `base` attributes are pointing to the `welcome-dashboard` folder:
144
144
145
145
```typescript
146
-
entry: "src/welcome-dashboard.element.ts"
146
+
import { defineConfig } from"vite";
147
+
148
+
exportdefaultdefineConfig({
149
+
build: {
150
+
lib: {
151
+
entry: "src/welcome-dashboard.element.ts", // your web component source file
152
+
formats: ["es"],
153
+
},
154
+
outDir: "../App_Plugins/welcome-dashboard", // all compiled files will be placed here
155
+
emptyOutDir: true,
156
+
sourcemap: true,
157
+
rollupOptions: {
158
+
external: [/^@umbraco/], // ignore the Umbraco Backoffice package in the build
159
+
},
160
+
},
161
+
base: "/App_Plugins/welcome-dashboard/", // the base path of the app in the browser (used for assets)
162
+
});
147
163
```
148
164
149
165
4. In the `welcome-dashboard` folder run `npm run build` and then run the project. Then in the content section of the Backoffice you will see our new dashboard:
0 commit comments