@adobe/aem-site-theme-builder

中文文档
6.0.1发布于 2026/05/11MIT License, Copyright 2020 Adobe Systems IncorporatedCommonJS近 30 天下载 8073

This repository contains scripts for building a Site Theme, ensuring compatibility with the requirements of AEM Site Templates. The recommended way of integrating the Theme Builder is to install it as an npm dependency of the Site Template Theme. This way

原始使用文档
文档目录12 节
  1. Installation
  2. Usage
  3. Proxy
  4. Live Preview
  5. Theme Deployment
  6. Complete development workflow
  7. API
  8. Environment Variables
  9. Expected Output of Compiled Site Theme
  10. Release and publish
  11. Contributing
  12. Licensing

AEM Site Theme Builder

This repository contains scripts for building a Site Theme, ensuring compatibility with the requirements of AEM Site Templates. The recommended way of integrating the Theme Builder is to install it as an npm dependency of the Site Template Theme. This way aem-site-theme-builder commands can be used in NPM scripts. Example of such integration can be found in Standard Site Template.

Installation

cd <your-site-theme>
npm install @adobe/aem-site-theme-builder --save-dev

Usage

Proxy

Proxy your site running on AEM as a Cloud Service to localhost and replace requests made to the Site Theme with your locally compiled version of the Site Theme.

npx aem-site-theme-builder proxy

The URLs to a Site Theme can be provided via .env described in environment variables. In order to inject your locally compiled theme, the location of compiled site theme must match.

Live Preview

The live preview will run proxy server (desribed above) as well browser sync functionality. Browser sync will point to the proxied page and will be looking for changes in the dist folder and will refresh the page each time you got a change.

npx aem-site-theme-builder live

Theme Deployment

  1. Compile your theme and make the artifact available on GitHub. AEM as a Cloud Service will try to access https://api.github.com/repos/%GIT_ORG%/%GIT_REPO%/actions/artifacts/%GIT_ARTIFACT_ID%/zip in order to download the theme.
  2. Execute npx aem-site-theme-builder deploy in order to update the reference on AEM as a Cloud Service.

Complete development workflow

In order to make best use of theme-builder you have to run the live preview which provides proxy and browser sync functionalities. On top of that you need to make sure that you have additional watcher for your source files that triggers your theme build process which produces changes in the dist folder of your theme. This way after making change in your source file you will get your proxy page refreshed via browser sync.

API

Environment Variables

Theme Builder scripts are based on the environment variables you provide. These variables are used to properly provide live preview and deploy functionality of the AEM Site Theme Builder.

Here is the list of required variables:

AEM_URL=<URL of the AEM as a Cloud Service instance>
AEM_SITE=<name of the AEM site>
AEM_PROXY_PORT=<localhost proxy server port>

Here is the list of optional variables:

AEM_ADAPTIVE_FORM=<name of the AEM Form>

Recommended way to define site variables is to use / create .env file within your theme project repository.

Expected Output of Compiled Site Theme

You're free to use any build tools of your choice. The only contract with the Site Theme Builder is that the compiled artifact shall be provided as follows:

dist/
    css/
        theme.css
    js/
        theme.js
    resources/
        a-font.font
        an-image.png

Release and publish

Run the "Release and publish" GitHub workflow and provide the semantic version you're about to release.

Contributing

Contributions are welcomed! Read the Contributing Guide for more information.

Licensing

This project is licensed under the MIT License. See LICENSE for more information.

版本与发布记录

@adobe/aem-site-theme-builder 共发布 21 个版本,首次发布于 2020/10/27;过去 12 个月发布了 1 个版本。

版本发布日期距今
6.0.1latest2026/05/115 个月前
6.0.02025/07/301.3 年前
5.3.02022/10/124 年前
5.2.12021/11/304 年前
5.2.02021/11/174 年前
5.1.22021/10/225 年前

关于 @adobe/aem-site-theme-builder 的常见问题

@adobe/aem-site-theme-builder 是什么?

This repository contains scripts for building a Site Theme, ensuring compatibility with the requirements of AEM Site Templates. The recommended way of integrating the Theme Builder is to install it as an npm dependency of the Site Template Theme. This way

如何安装 @adobe/aem-site-theme-builder?

在项目目录运行 npm install @adobe/aem-site-theme-builder,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 aem-site-theme-builder,可以用 npx aem-site-theme-builder 直接运行。

@adobe/aem-site-theme-builder 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/adobe__aem-site-theme-builder 是否存在。

@adobe/aem-site-theme-builder 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@adobe/aem-site-theme-builder 可以商用吗?

@adobe/aem-site-theme-builder 使用 MIT License, Copyright 2020 Adobe Systems Incorporated 许可。声明的许可为 MIT License, Copyright 2020 Adobe Systems Incorporated,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@adobe/aem-site-theme-builder 的下载量有多少?

根据 npm 官方下载统计,@adobe/aem-site-theme-builder 在 2026/10/05 – 2026/11/03 这 30 天内被下载 8,073 次,日均约 269 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@adobe/aem-site-theme-builder 还在维护吗?

最新版本 6.0.1 发布于 2026/05/11(5 个月前);至今共发布 21 个版本,其中过去 12 个月发布了 1 个;首次发布于 2020/10/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。