@afterpack/nuxt

Nuxt 3 module for AfterPack: obfuscate a Nuxt app's production JavaScript during the build
1,460 2
Install
npm install @afterpack/nuxt
Latest Version:0.2.7
Vue:3
License:Apache-2.0
Last Updated:Oct 22, 2026
Links: GitHub  ·  npm
Maintainer: afterpack

@afterpack/nuxt

A Nuxt 3 module that obfuscates your production JavaScript, using the AfterPack JavaScript obfuscator.

Install

npm install --save-dev @afterpack/nuxt

Usage

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ["@afterpack/nuxt"],
  afterpack: {
    seed: "git",
  },
});

The module adds AfterPack to Nuxt's Vite build, so every JavaScript chunk is obfuscated before it is written. That covers the client bundle of a server-rendered app and the prerendered output of nuxt generate in .output/public/_nuxt/. A failed run fails the build.

Options under the afterpack key are the same as @afterpack/vite.

The options you are most likely to set are preset, complexity, seed, identifiers.reserved for names that must stay as they are, paths.exclude for files to leave alone, and build.autorun to turn AfterPack off. Every other option is in the configuration reference. Options can also live in afterpack.json or in AFTERPACK_* environment variables.

Nuxt 2 builds with webpack. Use @afterpack/webpack there.

Pro

Without a key, AfterPack runs on your machine with the full pipeline at any preset. Set AFTERPACK_KEY in your environment and the same module builds in AfterPack's cloud instead, which adds per-region directives and two hardening transforms you can turn on: self-integrity, which detects edits to its own check table only, not edits elsewhere in your code, and comparison hardening. Keep the key out of nuxt.config.ts. See AfterPack Pro.

Links

License

Apache-2.0. The engine it runs, @afterpack/core, has its own license.

Feedback

Questions, suggestions and bug reports: afterpack.dev/contact. You can also file a bug on GitHub Issues.

Related Packages

@afterpack/vue

Vue 3 plugin for AfterPack: obfuscate a Vue app's production JavaScript during t...

1,424 2
@oro.ad/nuxt-claude-devtools-bc

Nuxt module for automatic Vite dev server configuration with tunnels (Cloudflare...

12,872 2
vue-tailwind-block

Keep long Tailwind utility classes out of your Vue templates with a typed YAML b...

569 0
@privyid/nuxt-csrf

Module CSRF for NUXT

26,088 9

Version History

Version Released License
0.2.7 Apache-2.0
0.2.6 Apache-2.0
0.2.5 Apache-2.0
0.2.4 Apache-2.0
0.2.3 Apache-2.0
Pre-releases (3)
Version Released License
0.2.0-rc.20260930T1421 Apache-2.0
0.1.0-rc.20260925T1355 Apache-2.0
0.1.0-rc.20260925T1347 Apache-2.0