Instrumentation engine for the CodePress visual editor. Ships Babel and SWC plugins, a webpack plugin, a development server, and a CLI for React and Next.js projects.
npm install @codepress/codepress-engine// next.config.mjsimport{createSWCPlugin}from"@codepress/codepress-engine/swc";importCodePressWebpackPluginfrom"@codepress/codepress-engine/webpack-plugin";constnextConfig={experimental: {swcPlugins: [createSWCPlugin()],},webpack: (config,{ isServer, dev })=>{config.plugins.push(newCodePressWebpackPlugin({ isServer, dev }));returnconfig;},};exportdefaultnextConfig;// babel.config.mjsexportdefault{plugins: ["@codepress/codepress-engine"],};// vite.config.tsimport{codepressVitePlugin}from"@codepress/codepress-engine/vite-plugin";exportdefault{plugins: [codepressVitePlugin()],};Run the CodePress dev server alongside your app for local visual editing:
npx codepress && npm startSee npx codepress help for all available commands.
| Export | Description |
|---|---|
@codepress/codepress-engine | Main entry (Babel plugin) |
@codepress/codepress-engine/babel | Babel plugin (CommonJS) |
@codepress/codepress-engine/swc | SWC plugin factory & WASM helpers |
@codepress/codepress-engine/webpack-plugin | Webpack plugin for production module map |
@codepress/codepress-engine/vite-plugin | Vite plugin |
@codepress/codepress-engine/esbuild | esbuild plugin |
@codepress/codepress-engine/server | Fastify development server |
@codepress/codepress-engine/cli | CLI (codepress binary) |
- Build time — The Babel or SWC plugin injects
codepress-data-fpattributes into JSX elements, encoding source file paths and line numbers - Runtime — The CodePress browser extension reads these attributes to identify source locations when you select an element
- Editing — Changes flow to either the local dev server (writes to disk) or the CodePress backend (commits to GitHub)
- Production — The webpack plugin creates a module map enabling hot module replacement in production builds
Found a bug? Open an issue on this repository.
Copyright (c) 2025 CodePress. All rights reserved. See LICENSE for details.