Skip to main content
Export lets you package your scripts for delivery outside of GoodCraft Script. Use it for client handoffs, self-hosting, or backups.

When to Export

Export your scripts when:
  • Client handoff: Delivering final code to a client who won’t use GoodCraft Script
  • Self-hosting: Hosting scripts on your own CDN or server
  • Backup: Creating a local copy of all your scripts
  • Migration: Moving scripts to another system
For most workflows, you don’t need to export. The loader script serves your code automatically with caching and optimization.

Export Modes

GoodCraft Script offers two export modes:

Compressed Mode

Bundles all your scripts into a single file with built-in page routing. Output:
  • One JavaScript file (contains all JS scripts)
  • One CSS file (contains all CSS scripts)
How it works:
  • Scripts are combined in priority order
  • Page-specific scripts include routing logic
  • The bundle checks the current URL and runs matching scripts
Best for:
  • Simple handoffs
  • Single injection point
  • When you want minimal files
// Example compressed output
(function() {
  const currentPath = window.location.pathname;

  // Global scripts
  console.log('Site loaded');

  // Page-specific scripts
  if (currentPath === '/about' || currentPath.startsWith('/about/')) {
    // About page script
  }
})();

Expanded Mode

Generates separate scripts with placement instructions. Output:
  • Individual script files
  • Instructions for where to place each one
Includes:
  • Head code (dependencies, early-loading scripts)
  • Global JavaScript (footer)
  • Global CSS (head)
  • Per-page scripts with specific instructions
Best for:
  • Detailed client handoffs
  • When clients need to understand each script
  • Webflow-native implementations
## Placement Instructions

### Head Code
Add this to Project Settings > Custom Code > Head Code:
[code block]

### Footer Code
Add this to Project Settings > Custom Code > Footer Code:
[code block]

### /about Page
Add this to the About page settings:
[code block]

Export Options

Minify

Compresses the output by removing whitespace and shortening variable names.
  • On (default): Smaller file size, harder to read
  • Off: Readable code, larger file size
Turn off minification for client handoffs where they might need to read or modify the code.

Wrap in DOM Ready

Wraps scripts in a DOMContentLoaded event listener.
  • On (default): Scripts wait for the DOM to be ready
  • Off: Scripts run immediately
// With DOM Ready wrapping
document.addEventListener('DOMContentLoaded', function() {
  // Your code here
});

// Without wrapping
// Your code here (runs immediately)

How to Export

1

Go to Export

Open your site and click the Export tab.
2

Choose a mode

Select Compressed or Expanded based on your needs.
3

Configure options

Toggle minification and DOM Ready wrapping as needed.
4

Preview

Review the generated code in the preview panel.
5

Copy or Download

Click Copy to copy to clipboard, or Download to save as files.

Webflow Character Limits

Webflow has a 50,000 character limit for custom code fields. When exporting for Webflow, GoodCraft Script tracks this limit:
  • Warning threshold: At 40,000 characters, you’ll see a warning
  • Limit exceeded: At 50,000 characters, the code won’t fit in Webflow
If you exceed the limit, consider:
  • Splitting scripts into page-specific code
  • Using external scripts from CDN for large libraries
  • Keeping the loader approach instead of exporting
The character count includes all whitespace and comments. Minification significantly reduces the count.

Change Detection

GoodCraft Script tracks whether your scripts have changed since the last export. In the Export tab, you’ll see:
  • Last exported: When you last exported
  • Changes detected: Number of scripts modified since then
  • Status indicator: Green (no changes) or yellow (changes pending)
This helps you know when to re-export for clients.

Export Best Practices

Clients appreciate clear instructions on where to paste each piece of code. Expanded mode provides this context.
If the client might need to modify the code later, export without minification so it’s readable.
Before exporting, make sure script names are descriptive. These names appear in the export instructions.
Always test the exported code on a staging site before delivering to clients.
The loader provides automatic updates, caching, and optimization. Only export when you specifically need standalone files.

Client Handoff Checklist

When delivering exported scripts to a client: