Skip to content

Building for Production ​

Running the Build ​

bash
acodez build

This runs acodez build and produces a production-ready plugin.zip ready for distribution or submission to the official Acode Store.


What Happens During a Build ​

1. Clean previous build artifacts  (if --clean passed)
2. TypeScript / JS compilation     (Esbuild, ~30ms)
3. SASS → CSS string               (esbuild-sass-plugin)
4. Code minification               (Esbuild minifier, chrome90 target)
5. Source maps stripped            (Privacy + smaller bundle)
6. Icon & asset optimization      (Untouched if <=50KB, adaptive 40-50KB if >50KB)
7. Code obfuscation (if enabled)   (javascript-obfuscator)
8. plugin.zip assembled            (jszip)
9. Production Build Statistics     (File size report emitted)

Command Flags ​

  • acodez build --clean: Cleans dist/ and plugin.zip prior to compiling.
  • acodez build -o, --obfuscate: Force code obfuscation for the build without modifying package.json.
  • acodez build --no-obfuscate: Disable code obfuscation regardless of configuration file.
  • acodez build --json: Outputs build statistics and asset metrics in machine-readable JSON format (ideal for CI pipelines).
  • acodez build -q, --quiet: Suppresses terminal banners and spinners; exits cleanly with code 0 on success or code 1 on failure.

Enabling Code Obfuscation in Config ​

You can also enable obfuscation permanently in package.json:

json
{
  "acodez": {
    "obfuscate": true
  }
}

Or via acodez.config.js:

javascript
export default {
  obfuscate: true
};

Build Output & Report ​

After a successful build, acodez displays the Production Build Report:

  ╭──────────────┬───────────┬───────────────────────╮
  │ Output Asset │ Size      │ Optimization / Status │
  ├──────────────┼───────────┼───────────────────────┤
  │ dist/main.js │ 42.10 KB  │ Minified Bundle       │
  ├──────────────┼───────────┼───────────────────────┤
  │ icon.png     │ 18.40 KB  │ Plugin Icon           │
  ├──────────────┼───────────┼───────────────────────┤
  │ plugin.zip   │ 65.20 KB  │ ✔ Release Ready       │
  ╰──────────────┴───────────┴───────────────────────╯

Output files:

my-plugin/
├── dist/
│   └── main.js    ← Compiled, minified JavaScript bundle
└── plugin.zip     ← Packed package ready for Acode Store

Publishing to the Store ​

Once built, deploy directly using:

bash
acodez publish

Or use the automated GitHub Action workflow (.github/workflows/publish.yml) triggered whenever a GitHub release is published!

Built with precision by Rugved.