From 4b422ef45983dce99757e80c368f2e24e1ca714f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bel=C3=A9n=20Albeza?= Date: Thu, 28 Nov 2024 10:53:04 +0100 Subject: [PATCH] :books: Minor fix to plugin docs --- docs/plugins/create-a-plugin.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/plugins/create-a-plugin.md b/docs/plugins/create-a-plugin.md index 5363fa9be..967e81660 100644 --- a/docs/plugins/create-a-plugin.md +++ b/docs/plugins/create-a-plugin.md @@ -60,10 +60,10 @@ npm install @penpot/plugin-types If you're using typescript, don't forget to add @penpot/plugin-types to your typings in your tsconfig.json. -```json +```js { "compilerOptions": { - [...] + // ... "typeRoots": ["./node_modules/@types", "./node_modules/@penpot"], "types": ["plugin-types"], } @@ -148,7 +148,7 @@ If you're using Vite you can simply edit the configuration file and add the buil ```ts export default defineConfig({ -[...] + // ... build: { rollupOptions: { input: { @@ -168,11 +168,12 @@ export default defineConfig({ And then add the following scripts to your package.json: -```json +```js "scripts": { - "dev": "vite build --watch & vite preview", + "dev": "vite dev", "build": "tsc && vite build", - [...] + "preview": "npm run build && vite preview", + // ... } ``` @@ -190,11 +191,11 @@ esbuild your-folder/plugin.ts --minify --outfile=your-folder/public/plugin.js You can add it to your package.json scripts so you don't need to manually re-run the build: -```json +```js "scripts": { "start": "npm run build:plugin && ng serve", "build:plugin": "esbuild your-folder/plugin.ts --minify --outfile=your-folder/public/plugin.js" - [...] + // ... }, ```