mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 05:33:02 -05:00
fixes
This commit is contained in:
parent
3ec79dab48
commit
2744930ada
2 changed files with 3 additions and 3 deletions
|
@ -5,7 +5,7 @@
|
|||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "npm run build:ui && npm run build:main -- --minify",
|
||||
"build:main": "esbuild plugin-src/code.ts --bundle --outfile=dist/code.js",
|
||||
"build:main": "esbuild plugin-src/code.ts --bundle --outfile=dist/code.js --target=es2016",
|
||||
"build:ui": "vite build --minify esbuild --emptyOutDir=false",
|
||||
"build:watch": "concurrently -n widget,iframe \"npm run build:main -- --watch\" \"npm run build:ui -- --watch\"",
|
||||
"dev": "concurrently -n tsc,build,vite 'npm:tsc:watch' 'npm:build:watch' 'vite'",
|
||||
|
|
|
@ -16,14 +16,14 @@ export const PenpotExporter = () => {
|
|||
};
|
||||
|
||||
const onMessage = (event: MessageEvent<{ pluginMessage: { type: string; data: unknown } }>) => {
|
||||
if (event.data.pluginMessage.type == 'FIGMAFILE') {
|
||||
if (event.data.pluginMessage?.type == 'FIGMAFILE') {
|
||||
const document = event.data.pluginMessage.data as PenpotDocument;
|
||||
const file = createPenpotFile(document);
|
||||
|
||||
file.export();
|
||||
|
||||
setExporting(false);
|
||||
} else if (event.data.pluginMessage.type == 'FONT_NAME') {
|
||||
} else if (event.data.pluginMessage?.type == 'FONT_NAME') {
|
||||
const fontName = event.data.pluginMessage.data as string;
|
||||
|
||||
if (!validateFont(fontName)) {
|
||||
|
|
Loading…
Reference in a new issue