0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2025-04-18 01:34:17 -05:00
This commit is contained in:
Alex Sánchez 2024-10-25 12:50:46 +02:00
parent d73f81219a
commit 831f1916e6
No known key found for this signature in database
GPG key ID: 9EB820F2C89412B9
4 changed files with 10 additions and 6 deletions

View file

@ -16,7 +16,7 @@
<a href="https://penpot.app/"><b>Penpot Website</b></a>
<a href="https://community.penpot.app/t/figma-to-penpot-export-plugin/5554"><b>Export Figma to Penpot (Penpot community)</b></a>
<a href="https://community.penpot.app/"><b>Penpot Community</b></a>
<a href="https://www.figma.com/community/plugin/1219369440655168734/penpot-exporter"><b>Plugin in Figma community</b></a>
<a href="https://www.figma.com/community/plugin/1219369440655168734/penpot-exporter"><b>Plugin in Figma community</b></a>
</p>
<p align="center">
@ -96,6 +96,9 @@ then selecting "Download ZIP". Extract the ZIP file to a location on your comput
3. Once you are in the correct folder, you can run the `npm install` command to install the
dependencies, and then the `npm run build` command to build the plugin.
#### Building for production:
Follow the same steps as above, but instead of running `npm run build`, run `npm run build:prod`.
### Add to Figma
`Figma menu` > `Plugins` > `Development` > `Import plugin from manifest…` To add the plugin to

View file

@ -4,7 +4,8 @@
"description": "Penpot exporter",
"type": "module",
"scripts": {
"build": "concurrently -n widget,iframe 'npm:build:main' 'npm:build:ui'",
"build": "concurrently -n widget,iframe 'npm:build:main' 'npm:build:ui -- --mode development'",
"build:prod": "concurrently -n widget,iframe 'npm:build:main' 'npm:build:ui -- --mode production'",
"build:main": "esbuild plugin-src/code.ts --bundle --outfile=dist/code.js --target=es2016 --minify",
"build:ui": "vite build",
"build:watch": "concurrently -n widget,iframe 'npm:build:main -- --watch' 'npm:build:ui -- --watch'",

View file

@ -1,7 +1,7 @@
import mixpanel from 'mixpanel-figma';
export const track = (name: string, opts = {}) => {
if (import.meta.env.VITE_MIXPANEL_TOKEN) {
if (import.meta.env.VITE_MIXPANEL_TOKEN && import.meta.env.PROD) {
opts = {
...opts,
'Plugin Version': APP_VERSION
@ -11,7 +11,7 @@ export const track = (name: string, opts = {}) => {
};
export const identify = ({ userId }: { userId: string }) => {
if (import.meta.env.VITE_MIXPANEL_TOKEN) {
if (import.meta.env.VITE_MIXPANEL_TOKEN && import.meta.env.PROD) {
mixpanel.identify(userId);
mixpanel.people.set({
@ -22,7 +22,7 @@ export const identify = ({ userId }: { userId: string }) => {
};
export const initializeMixpanel = () => {
if (import.meta.env.VITE_MIXPANEL_TOKEN) {
if (import.meta.env.VITE_MIXPANEL_TOKEN && import.meta.env.PROD) {
mixpanel.init(import.meta.env.VITE_MIXPANEL_TOKEN, {
disable_cookie: true,
disable_persistence: true,

View file

@ -1,7 +1,7 @@
import * as Sentry from '@sentry/react';
export const initializeSentry = () => {
if (import.meta.env.VITE_SENTY_DSN) {
if (import.meta.env.VITE_SENTY_DSN && import.meta.env.PROD) {
Sentry.init({
dsn: import.meta.env.VITE_SENTRY_DSN,
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],