Ctrl+K
v3.0.5

Build & Distribution

Production build files, asset breakdown, distribution options, and optimization tips.

Main Build Files

Imigi provides two build formats for different use cases.

UMD Build (dist-umd/) — Recommended for CDN/Script Tag

FileSizeDescription
imigi.umd.js1.15 MBMain library (minified)
style.css65 KBStyles

Total code size: ~1.2 MB (~300–400 KB gzipped)

Use this build for:

HTML
<link rel="stylesheet" href="imigi/style.css">
<script src="imigi/imigi.umd.js"></script>
<script>
  Imigi.init({ selector: '#editor' });
</script>

ES Module Build (dist/) — For Bundlers

FileSizeDescription
imigi.es.js1.74 MBES Module (tree-shakeable)
style.css65 KBStyles

Use this build for:

JavaScript
import Imigi from 'imigi';
import 'imigi/style.css';

Imigi.init({ selector: '#editor' });

Assets

Assets are loaded on-demand based on which tools are used. Users only download what they need.

Fonts (21 files)

Located in dist/fonts/.

FontFile
Aleoaleo-v4-latin-ext_latin-700.woff2
Amatic SCamatic-sc-v16-latin-ext_latin-regular.woff2
Bungee Inlinebungee-inline-v6-latin-ext_latin-regular.woff2
Carter Onecarter-one-v12-latin-regular.woff2
Codystarcodystar-v10-latin-ext_latin-regular.woff2
Corinthiacorinthia-v7-latin-ext_latin-700.woff2
Fira Sansfira-sans-v11-latin-ext_latin_cyrillic-regular.woff2
Fuzzy Bubblesfuzzy-bubbles-v3-latin-700.woff2
Krona Onekrona-one-v9-latin-ext_latin-regular.woff2
Kumar One Outlinekumar-one-outline-v8-latin-ext_latin-regular.woff2
Lobster Twolobster-two-v13-latin-regular.woff2
Mollemolle-v11-latin-ext_latin-italic.woff2
Monotonmonoton-v10-latin-regular.woff2
Nixie Onenixie-one-v11-latin-regular.woff2
Open Sansopen-sans-v27-latin-ext_latin-regular.woff2
Permanent Markerpermanent-marker-v10-latin-regular.woff2
Roboto Slabroboto-slab-v16-latin-ext_latin-500.woff2
Sancreeksancreek-v13-latin-ext_latin-regular.woff2
Stint Ultra Expandedstint-ultra-expanded-v10-latin-regular.woff2
TrashHandTrashHand.ttf
VT323vt323-v12-latin-ext_latin-regular.woff2

Filter Previews (27 files)

Thumbnail images for the filter selection UI. Located in dist/images/filter/.

FilterFile
Originaloriginal.jpg
Grayscalegrayscale.jpg
Black & WhiteblackWhite.jpg
Sepiasepia.jpg
Vintagevintage.jpg
Polaroidpolaroid.jpg
Kodachromekodachrome.jpg
Technicolortechnicolor.jpg
Browniebrownie.jpg
Sharpensharpen.jpg
Blurblur.jpg
Embossemboss.jpg
Invertinvert.jpg
Brightnessbrightness.jpg
Gammagamma.jpg
Noisenoise.jpg
Pixelatepixelate.jpg
Remove ColorremoveColor.jpg
Blend ColorblendColor.jpg

Frames (~100 files)

Decorative frame images for the frame tool. Located in dist/images/frames/.

FrameFiles
basicthumbnail.png
art19 images (corners + sides)
art29 images
ebony9 images
grunge19 images
grunge29 images
oak9 images
pine9 images
rainbow9 images
walnut9 images

Stickers (472 SVG files)

Emoji and shape stickers organized by category. Located in dist/images/stickers/.

CategoryCount
Emoticons~50
Doodles~30
Shapes~20
Arrows~15
Other categories~357

Brush Textures (14 files)

Brush pattern images for the drawing tool. Located in dist/images/brushes/.

BrushVariants
circleblack, white
diamondblack, white
hlineblack, white
pencilblack, white
sprayblack, white
squareblack, white
vlineblack, white

Minimal Distribution

For a minimal installation, you only need the core files:

File structure
dist-umd/
├── imigi.umd.js    (1.15 MB)
└── style.css       (65 KB)

Total: ~1.2 MB (ungzipped)

Assets are optional and loaded on-demand. If you don't use certain features, you can omit their assets:

Feature Not UsedAssets You Can Omit
Text toolfonts/ folder
Filter toolimages/filter/ folder
Frame toolimages/frames/ folder
Stickers toolimages/stickers/ folder
Draw toolimages/brushes/ folder

Full Distribution Size

BuildSize
dist-umd/24 MB
dist/29 MB

File Count Summary

TypeCount
JavaScript1
CSS1
PNG images256
JPG images27
SVG images472
Font files21
Total~780

Build Commands

Bash
# Build ES Module (dist/)
npm run build

# Build UMD (dist-umd/)
npm run build:umd

# Build both
npm run build && npm run build:umd

CDN Usage

Host Imigi on a CDN for fast global delivery. Use the basePath option so the editor knows where to find on-demand assets.

HTML
<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="https://cdn.example.com/imigi/1.0.0/style.css">
</head>
<body>
  <div id="editor"></div>

  <script src="https://cdn.example.com/imigi/1.0.0/imigi.umd.js"></script>
  <script>
    Imigi.init({
      selector: '#editor',
      // Assets will be loaded from the same CDN path
      basePath: 'https://cdn.example.com/imigi/1.0.0/',
    });
  </script>
</body>
</html>

Optimization Tips

1. Gzip / Brotli Compression

Enable server compression to significantly reduce transfer size:

FileOriginalGzippedBrotli
imigi.umd.js1.15 MB~350 KB~280 KB
style.css65 KB~12 KB~10 KB

2. Lazy Load Assets

Assets are loaded on-demand by default. Users only download what they use. No extra configuration is required.

3. Disable Unused Tools

Disable tools you don't need to prevent their assets from loading:

JavaScript
Imigi.init({
  selector: '#editor',
  tools: {
    crop: { enabled: true },
    filter: { enabled: false },     // Won't load filter thumbnails
    stickers: { enabled: false },   // Won't load sticker SVGs
  },
});

4. Self-Host Critical Assets

Host frequently-used assets on your own CDN for better caching control:

JavaScript
Imigi.init({
  selector: '#editor',
  basePath: '/assets/imigi/',
});
Tip

Setting basePath tells Imigi where to look for all on-demand assets (fonts, filter previews, frames, stickers, brushes). Make sure the directory structure under the base path matches the default dist/ layout.

On This Page
Main Build Files UMD Build ES Module Build Assets Fonts Filter Previews Frames Stickers Brush Textures Minimal Distribution Full Distribution Size Build Commands CDN Usage Optimization Tips