0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-08 08:09:14 -05:00

📚 Minor fix to plugin docs

This commit is contained in:
Belén Albeza 2024-11-28 10:53:04 +01:00
parent c2649ffd1c
commit 4b422ef459

View file

@ -60,10 +60,10 @@ npm install @penpot/plugin-types
If you're using typescript, don't forget to add <code class="language-js">@penpot/plugin-types</code> to your typings in your <code class="language-js">tsconfig.json</code>.
```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 <code class="language-js">package.json</code>:
```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 <code class="language-js">package.json</code> 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"
[...]
// ...
},
```