-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
52 lines (44 loc) · 1.11 KB
/
build.sh
File metadata and controls
52 lines (44 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# Figma Plugin Build and Development Script
# Uses esbuild to bundle src/ modules into a single code.js
set -e
echo "🔨 Figma Plugin Build Starting..."
# Check dependencies
if [ ! -d "node_modules" ]; then
echo "📦 Installing dependencies..."
npm install
fi
# Bundle with esbuild
echo "⚙️ Bundling with esbuild (src/ → code.js)..."
node esbuild.config.js
# Check if code.js was created
if [ -f "code.js" ]; then
echo "✅ code.js created successfully"
else
echo "❌ code.js could not be created"
exit 1
fi
# Check HTML file
if [ -f "ui.html" ]; then
echo "✅ ui.html file found"
else
echo "⚠️ ui.html file not found"
fi
# Check manifest
if [ -f "manifest.json" ]; then
echo "✅ manifest.json file found"
else
echo "❌ manifest.json file required!"
exit 1
fi
echo ""
echo "🎉 Build completed!"
echo ""
echo "Next steps:"
echo "1. Open Figma"
echo "2. Plugins → Development → New plugin"
echo "3. Select manifest.json file"
echo "4. Observe the plugin panel opening"
echo ""
echo "🔄 For automatic compilation during development:"
echo " npm run watch"