Webpack Bundler for Adobe CEP
raw JSON →cep-bundler-webpack is a specialized Webpack bundler designed for creating Adobe Common Extensibility Platform (CEP) extensions, specifically supporting ExtendScript and modern web technologies like TypeScript. Currently at version 0.2.0, it provides a `createConfig` function to generate a Webpack configuration tailored for CEP's unique requirements, abstracting away much of the boilerplate. It is part of the `adobe-extension-tools` ecosystem, indicating its close association with Adobe extension development efforts. While at an early version, it aims to streamline the development workflow for Adobe Creative Cloud extensions by handling complex build processes, enabling features like TypeScript compilation. Its primary differentiator is its deep integration with the Adobe CEP environment, providing an opinionated but flexible build setup for a niche, yet powerful, extension platform.
Common errors
error TypeError: createConfig is not a function OR SyntaxError: Cannot use import statement outside a module ↓
import { createConfig } from 'cep-bundler-webpack'; to const { createConfig } = require('cep-bundler-webpack'); in your webpack.config.js. If your package.json specifies "type": "module", rename webpack.config.js to webpack.config.cjs. error Error: Webpack can't find 'some-module' OR Module not found: Error: Can't resolve 'some-module' ↓
webpack, webpack-cli, and any loaders/plugins referenced in createConfig or your custom config are installed (e.g., npm install --save-dev webpack webpack-cli ts-loader). Verify that entry and output paths are correct in your webpack.config.js. error Error: Manifest.xml could not be generated OR Extension does not appear in Adobe host application ↓
cep object passed to createConfig for correct id, name, version, and hosts. Refer to cep-bundler-core documentation for expected CEP configuration schema. Ensure the build output matches the structure expected by Adobe applications for extensions. Warnings
breaking As this package is in an early development phase (v0.2.0), minor version updates may introduce breaking changes to the `createConfig` API or the generated Webpack configuration structure. Developers should pin exact versions and review release notes carefully. ↓
gotcha Webpack configuration files (like `webpack.config.js`) must be written in CommonJS (`module.exports = { ... }`) syntax, even if your main project uses ES Modules (`"type": "module"` in `package.json`). Using `import` statements directly in `webpack.config.js` will cause build failures. ↓
gotcha This bundler is specifically tailored for Adobe CEP extensions. Attempting to use it for generic web projects or other plugin architectures will likely result in incorrect configurations or missing functionalities, as it expects specific CEP manifest and runtime considerations. ↓
gotcha Developing Adobe CEP extensions requires specific debugging setups (e.g., debug mode enabled in `manifest.xml`, Chrome DevTools for the browser context, and ESTK/VS Code for ExtendScript). This bundler facilitates the build, but developers must still understand the CEP debugging workflow. ↓
Install
npm install cep-bundler-webpack yarn add cep-bundler-webpack pnpm add cep-bundler-webpack Imports
- createConfig wrong
import { createConfig } from 'cep-bundler-webpack';correctconst { createConfig } = require('cep-bundler-webpack');
Quickstart
// webpack.config.js
const { createConfig } = require('cep-bundler-webpack');
module.exports = createConfig({
// Entry point for your CEP extension's UI
entry: './src/index.ts',
// Output directory for the bundled files
output: {
filename: 'bundle.js',
path: require('path').resolve(__dirname, 'dist/client'),
},
// Additional Webpack configuration specific to your project
// For example, if you need custom loaders or plugins
devServer: {
port: 9000,
hot: true,
compress: true,
static: { directory: require('path').join(__dirname, 'dist') },
},
// CEP-specific configuration, often managed via package.json or environment vars
// This object allows direct override or extension of generated CEP manifest data
cep: {
id: 'com.yourcompany.yourextension',
name: 'My CEP Extension',
version: '1.0.0',
hosts: ['PHXS', 'ILST', 'IDSN'], // Specify target Adobe applications
// Other CEP-specific options like port, debug, etc.
},
});
// package.json (excerpt)
/*
{
"name": "my-cep-extension",
"version": "1.0.0",
"description": "A simple Adobe CEP extension",
"main": "index.js",
"scripts": {
"start": "webpack serve --config webpack.config.js",
"build": "webpack --config webpack.config.js --mode production",
"dev": "webpack --config webpack.config.js --mode development",
},
"keywords": ["Adobe", "CEP", "ExtendScript", "TypeScript", "Webpack"],
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"cep-bundler-webpack": "^0.2.0",
"webpack": "^5.0.0",
"webpack-cli": "^5.0.0",
"webpack-dev-server": "^4.0.0",
"typescript": "^5.0.0",
"ts-loader": "^9.0.0"
}
}
*/
// src/index.ts
import React from 'react';
import ReactDOM from 'react-dom/client';
const App: React.FC = () => {
return (
<div>
<h1>Hello, Adobe CEP!</h1>
<p>Bundled with cep-bundler-webpack</p>
</div>
);
};
const rootElement = document.getElementById('root');
if (rootElement) {
ReactDOM.createRoot(rootElement).render(
<React.StrictMode>
<App />
</React.StrictMode>
);
} else {
console.error('Root element not found');
}
// Basic ExtendScript communication (example)
declare global {
interface Window {
CSInterface: any; // Adobe CEP's CSInterface object
}
}
if (window.CSInterface) {
const csInterface = new window.CSInterface();
csInterface.evalScript('alert("Hello from ExtendScript!");');
}