@aemvite/aem-config 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +12 -0
- package/dist/buildClientlibs.d.ts.map +1 -1
- package/dist/buildClientlibs.js +113 -6
- package/dist/buildClientlibs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/mergeDefaults.d.ts.map +1 -1
- package/dist/mergeDefaults.js +3 -0
- package/dist/mergeDefaults.js.map +1 -1
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ All notable changes to **@aemvite/aem-config** will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.5.0] - 2026-06-26
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- `@aemvite/vite-plugin-aem-css-url-passthrough` wired in as a new transitive dependency; consumers get it automatically via `@aemvite/aem-config`.
|
|
12
|
+
- Plugin dependency ranges bumped to `^0.5.0`.
|
|
13
|
+
|
|
14
|
+
## [0.4.0] - 2026-06-26
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- Sourcemap support in the build orchestrator: external sourcemaps emitted by Vite are staged under `resources/sourcemaps/` and `sourceMappingURL` comments in JS/CSS are rewritten to point at the AEM-served resources path.
|
|
18
|
+
- `sourcemapPathTransform` in Rollup output options rewrites `sources[]` entries to `aemvite://<clientlib>/` virtual URLs for clean DevTools grouping.
|
|
19
|
+
- Symlink resolution via `realpathOrSelf` so path transforms work correctly on macOS where `/var` resolves to `/private/var`.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- Plugin dependency ranges bumped to `^0.4.0`.
|
|
23
|
+
- ES build target updated to `es2026`.
|
|
24
|
+
|
|
8
25
|
## [0.3.1] - 2026-06-26
|
|
9
26
|
|
|
10
27
|
### Added
|
package/README.md
CHANGED
|
@@ -170,6 +170,18 @@ asset and lets the other fall through to the next layer. So in production,
|
|
|
170
170
|
|
|
171
171
|
`sourcemap` and `target` are simple overrides — the higher layer wins entirely.
|
|
172
172
|
|
|
173
|
+
When `sourcemap` is `true` (or `"hidden"`), `buildClientlibs` post-processes
|
|
174
|
+
the Vite output so the emitted `.map` files land at
|
|
175
|
+
`clientlib-<name>/resources/sourcemaps/` (AEM serves them as static
|
|
176
|
+
resources) and the `//# sourceMappingURL=` comment inside the staged `.js` /
|
|
177
|
+
`.css` is rewritten to match. The `sources[]` array in each map is also
|
|
178
|
+
rewritten to a virtual `aemvite://<clientlib>/<project-relative>` URL so the
|
|
179
|
+
DevTools Sources tree is fetch-free, ignore-list-safe, and grouped by
|
|
180
|
+
clientlib. `"inline"` skips this layout — the map lives inside the `.js` as a
|
|
181
|
+
base64 data URI. See the
|
|
182
|
+
[Sourcemaps section in the root README](https://github.com/LucaNerlich/aem-vite#sourcemaps-when-enabled)
|
|
183
|
+
for the full on-disk layout, runtime resolution, and rationale.
|
|
184
|
+
|
|
173
185
|
### Global override
|
|
174
186
|
|
|
175
187
|
```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildClientlibs.d.ts","sourceRoot":"","sources":["../src/buildClientlibs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildClientlibs.d.ts","sourceRoot":"","sources":["../src/buildClientlibs.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,sBAAsB,EAGtB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAOpB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC;IAAE,MAAM,EAAE,iBAAiB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAiDxD"}
|
package/dist/buildClientlibs.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import {
|
|
2
|
+
import { realpathSync } from "node:fs";
|
|
3
|
+
import { readdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
3
4
|
import { loadAemConfig } from "./loadAemConfig.js";
|
|
4
5
|
import { resolveBuildOptions } from "./resolveBuildOptions.js";
|
|
5
6
|
/**
|
|
@@ -29,15 +30,17 @@ export async function buildClientlibs(options) {
|
|
|
29
30
|
const outDir = path.resolve(configDir, options.outDir ?? "dist");
|
|
30
31
|
const config = await loadAemConfig(configPath);
|
|
31
32
|
const clientLibRoot = path.resolve(configDir, config.clientLibRoot);
|
|
32
|
-
const [vite, glob, resources, clientlibPkg] = await Promise.all([
|
|
33
|
+
const [vite, glob, resources, cssUrl, clientlibPkg] = await Promise.all([
|
|
33
34
|
import("vite"),
|
|
34
35
|
import("@aemvite/vite-plugin-glob"),
|
|
35
36
|
import("@aemvite/vite-plugin-aem-resources"),
|
|
37
|
+
import("@aemvite/vite-plugin-aem-css-url-passthrough"),
|
|
36
38
|
import("@aemvite/vite-plugin-aem-clientlib"),
|
|
37
39
|
]);
|
|
38
40
|
const { build: viteBuild, mergeConfig } = vite;
|
|
39
41
|
const { aemViteGlob } = glob;
|
|
40
42
|
const { aemResources } = resources;
|
|
43
|
+
const { aemCssUrlPassthrough } = cssUrl;
|
|
41
44
|
const { emitClientlib } = clientlibPkg;
|
|
42
45
|
// Wipe the shared staging root once so subsequent per-clientlib builds
|
|
43
46
|
// accumulate into it without stale files.
|
|
@@ -49,20 +52,35 @@ export async function buildClientlibs(options) {
|
|
|
49
52
|
await viteBuild(buildInlineConfig(clientlib, config, configDir, stagingDir, mode, {
|
|
50
53
|
aemViteGlob,
|
|
51
54
|
aemResources,
|
|
55
|
+
aemCssUrlPassthrough,
|
|
52
56
|
mergeConfig,
|
|
53
57
|
}));
|
|
58
|
+
// When Vite emitted external sourcemaps, rewrite the `sourceMappingURL`
|
|
59
|
+
// comment in the staged .js/.css to point at the resources path AEM
|
|
60
|
+
// will actually serve them from (see `collectStagedFiles`).
|
|
61
|
+
await rewriteSourceMappingUrls(stagingDir, clientlib.name);
|
|
54
62
|
await collectStagedFiles(stagingDir, files);
|
|
55
63
|
}
|
|
56
64
|
await emitClientlib({ clientlib, outDir: clientLibRoot, files });
|
|
57
65
|
}
|
|
58
66
|
return { config, outDir };
|
|
59
67
|
}
|
|
60
|
-
function buildInlineConfig(clientlib, config, configDir, stagingDir, mode, { aemViteGlob, aemResources, mergeConfig }) {
|
|
68
|
+
function buildInlineConfig(clientlib, config, configDir, stagingDir, mode, { aemViteGlob, aemResources, aemCssUrlPassthrough, mergeConfig }) {
|
|
61
69
|
const entry = path.resolve(configDir, clientlib.entry);
|
|
62
70
|
const resolved = resolveBuildOptions(mode, config.build, clientlib.build);
|
|
71
|
+
// Resolve symlinks (e.g. macOS `/var` → `/private/var`) so the sourcemap
|
|
72
|
+
// path transform can reconcile with Rollup's real-path source references.
|
|
73
|
+
const realConfigDir = realpathOrSelf(configDir);
|
|
63
74
|
const resourceEntries = (clientlib.resources ?? []).map((from) => ({
|
|
64
75
|
from: path.resolve(configDir, from),
|
|
65
76
|
}));
|
|
77
|
+
// Per-clientlib value wins; explicit `false` opts out of an inherited global.
|
|
78
|
+
const cssUrlOption = clientlib.cssUrlPassthrough !== undefined
|
|
79
|
+
? clientlib.cssUrlPassthrough
|
|
80
|
+
: config.cssUrlPassthrough;
|
|
81
|
+
const cssUrlPlugin = cssUrlOption
|
|
82
|
+
? [aemCssUrlPassthrough(cssUrlOption === true ? {} : cssUrlOption)]
|
|
83
|
+
: [];
|
|
66
84
|
let inlineConfig = {
|
|
67
85
|
configFile: false,
|
|
68
86
|
root: configDir,
|
|
@@ -71,6 +89,7 @@ function buildInlineConfig(clientlib, config, configDir, stagingDir, mode, { aem
|
|
|
71
89
|
plugins: [
|
|
72
90
|
aemViteGlob(),
|
|
73
91
|
...(resourceEntries.length ? [aemResources(resourceEntries)] : []),
|
|
92
|
+
...cssUrlPlugin,
|
|
74
93
|
...(config.plugins ?? []),
|
|
75
94
|
...(clientlib.plugins ?? []),
|
|
76
95
|
],
|
|
@@ -96,6 +115,23 @@ function buildInlineConfig(clientlib, config, configDir, stagingDir, mode, { aem
|
|
|
96
115
|
assetFileNames: (info) => (info.name ?? "").toLowerCase().endsWith(".css")
|
|
97
116
|
? `${clientlib.name}.css`
|
|
98
117
|
: "[name][extname]",
|
|
118
|
+
// Rewrite sourcemap `sources[]` to a stable virtual URL rooted at
|
|
119
|
+
// the consumer project so DevTools (a) doesn't try to fetch the
|
|
120
|
+
// original files from the served `.js` path (where they don't
|
|
121
|
+
// exist) and (b) groups them under a clean `aemvite://<clientlib>/`
|
|
122
|
+
// tree in the Sources panel. `relativeSourcePath` is relative to
|
|
123
|
+
// the emitted `.map` file (i.e. the staging dir). We anchor on
|
|
124
|
+
// `stagingDir` and use the real (symlink-resolved) project root so
|
|
125
|
+
// paths reconcile cleanly on macOS where `/var` → `/private/var`.
|
|
126
|
+
// Vite/Rollup only invokes this when sourcemaps are emitted.
|
|
127
|
+
sourcemapPathTransform: (relativeSourcePath) => {
|
|
128
|
+
const abs = path.resolve(stagingDir, relativeSourcePath);
|
|
129
|
+
const rel = path
|
|
130
|
+
.relative(realConfigDir, abs)
|
|
131
|
+
.split(path.sep)
|
|
132
|
+
.join("/");
|
|
133
|
+
return `aemvite://${clientlib.name}/${rel}`;
|
|
134
|
+
},
|
|
99
135
|
},
|
|
100
136
|
},
|
|
101
137
|
},
|
|
@@ -106,24 +142,95 @@ function buildInlineConfig(clientlib, config, configDir, stagingDir, mode, { aem
|
|
|
106
142
|
inlineConfig = mergeConfig(inlineConfig, clientlib.vite);
|
|
107
143
|
return inlineConfig;
|
|
108
144
|
}
|
|
109
|
-
/**
|
|
145
|
+
/**
|
|
146
|
+
* Stage the per-entry JS/CSS plus any copied `resources/` tree, and route any
|
|
147
|
+
* sourcemap siblings (`*.js.map` / `*.css.map`) under `resources/sourcemaps/`
|
|
148
|
+
* so AEM serves them as plain static files. The emitter's `resources` bucket
|
|
149
|
+
* preserves the nested `sourcemaps/` prefix from the basename.
|
|
150
|
+
*
|
|
151
|
+
* AEM's clientlib aggregator concatenates `js/` / `css/` contents into one
|
|
152
|
+
* served response, and Sling URL decomposition (`site.js.map` → selectors=js,
|
|
153
|
+
* extension=map) 404s the top-level proxy path. Routing maps through the
|
|
154
|
+
* `resources/` subtree avoids both problems — the `sourceMappingURL` comment
|
|
155
|
+
* in the JS/CSS is rewritten to match (see `rewriteSourceMappingUrls`).
|
|
156
|
+
*/
|
|
110
157
|
async function collectStagedFiles(stagingDir, files) {
|
|
111
158
|
for (const entry of await readdir(stagingDir, { withFileTypes: true })) {
|
|
112
159
|
if (!entry.isFile())
|
|
113
160
|
continue;
|
|
114
|
-
const
|
|
115
|
-
|
|
161
|
+
const lower = entry.name.toLowerCase();
|
|
162
|
+
const ext = path.extname(lower);
|
|
163
|
+
const isCodeFile = ext === ".js" || ext === ".css";
|
|
164
|
+
const isSourcemap = lower.endsWith(".js.map") || lower.endsWith(".css.map");
|
|
165
|
+
if (isCodeFile) {
|
|
116
166
|
files.push({
|
|
117
167
|
source: path.join(stagingDir, entry.name),
|
|
118
168
|
basename: entry.name,
|
|
119
169
|
});
|
|
120
170
|
}
|
|
171
|
+
else if (isSourcemap) {
|
|
172
|
+
// Nested basename routes the map to `resources/sourcemaps/<file>` via
|
|
173
|
+
// the emitter's `resources` bucket (classifyFile routes `.map` there).
|
|
174
|
+
files.push({
|
|
175
|
+
source: path.join(stagingDir, entry.name),
|
|
176
|
+
basename: `sourcemaps/${entry.name}`,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
121
179
|
}
|
|
122
180
|
const resourcesDir = path.join(stagingDir, "resources");
|
|
123
181
|
for (const rel of await walk(resourcesDir)) {
|
|
124
182
|
files.push({ source: path.join(resourcesDir, rel), basename: rel });
|
|
125
183
|
}
|
|
126
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* Rewrite the `sourceMappingURL` comment in every staged `.js` / `.css` so it
|
|
187
|
+
* points at the AEM-served resources path where `collectStagedFiles` will
|
|
188
|
+
* deposit the corresponding `.map`. The browser resolves `sourceMappingURL`
|
|
189
|
+
* relative to the served code URL; for an AEM clientlib aggregated at
|
|
190
|
+
* `/etc.clientlibs/<proj>/clientlibs/clientlib-<name>.js`, a relative URL of
|
|
191
|
+
* `clientlib-<name>/resources/sourcemaps/<file>.map` resolves to the static
|
|
192
|
+
* resource served by AEM at the same path.
|
|
193
|
+
*
|
|
194
|
+
* Vite emits the comment as the final line(s) of the file:
|
|
195
|
+
* JS: `//# sourceMappingURL=site.js.map`
|
|
196
|
+
* CSS: `/*# sourceMappingURL=site.css.map *\/`
|
|
197
|
+
* We rewrite only the URL token, leaving everything else untouched.
|
|
198
|
+
*/
|
|
199
|
+
async function rewriteSourceMappingUrls(stagingDir, clientlibName) {
|
|
200
|
+
let entries;
|
|
201
|
+
try {
|
|
202
|
+
entries = await readdir(stagingDir, { withFileTypes: true });
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
for (const entry of entries) {
|
|
208
|
+
if (!entry.isFile())
|
|
209
|
+
continue;
|
|
210
|
+
const lower = entry.name.toLowerCase();
|
|
211
|
+
if (lower.endsWith(".map"))
|
|
212
|
+
continue;
|
|
213
|
+
if (!lower.endsWith(".js") && !lower.endsWith(".css"))
|
|
214
|
+
continue;
|
|
215
|
+
const full = path.join(stagingDir, entry.name);
|
|
216
|
+
const content = await readFile(full, "utf8");
|
|
217
|
+
const mapName = `${entry.name}.map`;
|
|
218
|
+
const newUrl = `clientlib-${clientlibName}/resources/sourcemaps/${mapName}`;
|
|
219
|
+
let rewritten = content.replace(/\/\/# sourceMappingURL=[^\s]+/, `//# sourceMappingURL=${newUrl}`);
|
|
220
|
+
rewritten = rewritten.replace(/\/\*# sourceMappingURL=[^\s]+ \*\//, `/*# sourceMappingURL=${newUrl} */`);
|
|
221
|
+
if (rewritten !== content) {
|
|
222
|
+
await writeFile(full, rewritten, "utf8");
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function realpathOrSelf(p) {
|
|
227
|
+
try {
|
|
228
|
+
return realpathSync(p);
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
return p;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
127
234
|
async function walk(dir, prefix = "") {
|
|
128
235
|
let entries;
|
|
129
236
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildClientlibs.js","sourceRoot":"","sources":["../src/buildClientlibs.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"buildClientlibs.js","sourceRoot":"","sources":["../src/buildClientlibs.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAa/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,OAA+B;IAE/B,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IACrC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,IAAI,CAAC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,CAAC;AAED,KAAK,UAAU,IAAI,CAAC,GAAW,EAAE,MAAM,GAAG,EAAE;IAC1C,IAAI,OAAO,CAAC;IACZ,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5D,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QAC7D,CAAC;aAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;YAC1B,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export { mergeDefaults } from "./mergeDefaults.js";
|
|
|
4
4
|
export { buildClientlibs } from "./buildClientlibs.js";
|
|
5
5
|
export { defaults, defaultTarget, modeBaselines } from "./defaults.js";
|
|
6
6
|
export { resolveBuildOptions } from "./resolveBuildOptions.js";
|
|
7
|
-
export type { AemClientlib, AemConfig, BuildClientlibsOptions, BuildMode, BuildOptions, ProcessorList, ResolvedAemClientlib, ResolvedAemConfig, ResolvedBuildOptions, } from "./types.js";
|
|
7
|
+
export type { AemClientlib, AemConfig, BuildClientlibsOptions, BuildMode, BuildOptions, CssUrlPassthroughOption, ProcessorList, ResolvedAemClientlib, ResolvedAemConfig, ResolvedBuildOptions, } from "./types.js";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EACV,YAAY,EACZ,SAAS,EACT,sBAAsB,EACtB,SAAS,EACT,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EACV,YAAY,EACZ,SAAS,EACT,sBAAsB,EACtB,SAAS,EACT,YAAY,EACZ,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeDefaults.d.ts","sourceRoot":"","sources":["../src/mergeDefaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,SAAS,EAET,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,iBAAiB,
|
|
1
|
+
{"version":3,"file":"mergeDefaults.d.ts","sourceRoot":"","sources":["../src/mergeDefaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,SAAS,EAET,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,iBAAiB,CAelE"}
|
package/dist/mergeDefaults.js
CHANGED
|
@@ -16,6 +16,9 @@ export function mergeDefaults(config) {
|
|
|
16
16
|
clientLibRoot: config.clientLibRoot,
|
|
17
17
|
clientlibs,
|
|
18
18
|
...(config.build !== undefined ? { build: config.build } : {}),
|
|
19
|
+
...(config.cssUrlPassthrough !== undefined
|
|
20
|
+
? { cssUrlPassthrough: config.cssUrlPassthrough }
|
|
21
|
+
: {}),
|
|
19
22
|
...(config.plugins !== undefined ? { plugins: config.plugins } : {}),
|
|
20
23
|
...(config.vite !== undefined ? { vite: config.vite } : {}),
|
|
21
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeDefaults.js","sourceRoot":"","sources":["../src/mergeDefaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAQzC;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,MAAiB;IAC7C,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;IAC3C,MAAM,UAAU,GAAG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WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,QAAQ,CAAC,WAAW;KACxD,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import type { PluginOption, UserConfig } from "vite";
|
|
2
2
|
export type ProcessorList = readonly string[];
|
|
3
|
+
/**
|
|
4
|
+
* Toggle / configure the CSS `url()` passthrough plugin
|
|
5
|
+
* (`@aemvite/vite-plugin-aem-css-url-passthrough`). When truthy, the plugin
|
|
6
|
+
* is auto-wired into each clientlib's build.
|
|
7
|
+
*
|
|
8
|
+
* - `true` — wire with default `resourceDirs` (`["images", "fonts"]`).
|
|
9
|
+
* - `false` — explicitly disable (overrides a global `true`).
|
|
10
|
+
* - object — wire with the supplied options.
|
|
11
|
+
*/
|
|
12
|
+
export type CssUrlPassthroughOption = boolean | {
|
|
13
|
+
resourceDirs?: readonly string[];
|
|
14
|
+
};
|
|
3
15
|
/**
|
|
4
16
|
* Author-facing build options. Each field is optional and overlays on top of
|
|
5
17
|
* the mode baseline (development/production) and the global `AemConfig.build`.
|
|
@@ -51,6 +63,12 @@ export interface AemClientlib {
|
|
|
51
63
|
jsProcessor?: ProcessorList;
|
|
52
64
|
/** Per-clientlib build overrides; layered over `AemConfig.build`. */
|
|
53
65
|
build?: BuildOptions;
|
|
66
|
+
/**
|
|
67
|
+
* Per-clientlib override for the CSS `url()` passthrough plugin. Takes
|
|
68
|
+
* precedence over the global `AemConfig.cssUrlPassthrough`. Set explicitly
|
|
69
|
+
* to `false` to opt out when the global is enabled.
|
|
70
|
+
*/
|
|
71
|
+
cssUrlPassthrough?: CssUrlPassthroughOption;
|
|
54
72
|
/**
|
|
55
73
|
* Extra Vite plugins applied to this clientlib's build, after the built-in
|
|
56
74
|
* `aemViteGlob` / `aemResources` and after `AemConfig.plugins`. Lets advanced
|
|
@@ -72,6 +90,14 @@ export interface AemConfig {
|
|
|
72
90
|
defaults?: Partial<AemClientlib>;
|
|
73
91
|
/** Global build options applied to every clientlib (overridden per-clientlib). */
|
|
74
92
|
build?: BuildOptions;
|
|
93
|
+
/**
|
|
94
|
+
* Auto-wire `@aemvite/vite-plugin-aem-css-url-passthrough` into every
|
|
95
|
+
* clientlib build. Restores webpack `css-loader: { url: false }` semantics:
|
|
96
|
+
* rewrites every `url(...)` containing `resources/<sub>/` back to the
|
|
97
|
+
* canonical `../resources/<sub>/<file>` form. Override per-clientlib via
|
|
98
|
+
* `AemClientlib.cssUrlPassthrough`.
|
|
99
|
+
*/
|
|
100
|
+
cssUrlPassthrough?: CssUrlPassthroughOption;
|
|
75
101
|
/**
|
|
76
102
|
* Extra Vite plugins applied to every clientlib build, after the built-in
|
|
77
103
|
* `aemViteGlob` / `aemResources` and before any per-clientlib `plugins`.
|
|
@@ -86,6 +112,8 @@ export interface ResolvedAemConfig {
|
|
|
86
112
|
clientlibs: ResolvedAemClientlib[];
|
|
87
113
|
/** Raw global build options (resolved per-mode at build time). */
|
|
88
114
|
build?: BuildOptions;
|
|
115
|
+
/** Global CSS `url()` passthrough toggle (resolved per-clientlib at build time). */
|
|
116
|
+
cssUrlPassthrough?: CssUrlPassthroughOption;
|
|
89
117
|
/** Global extra Vite plugins (applied to every clientlib build). */
|
|
90
118
|
plugins?: PluginOption[];
|
|
91
119
|
/** Global deep Vite config override. */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG,SAAS,MAAM,EAAE,CAAC;AAE9C;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,OAAO,GAAG;QAAE,EAAE,CAAC,EAAE,OAAO,CAAC;QAAC,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACnD,SAAS,C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E;IACrE,aAAa,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACjC,kFAAkF;IAClF,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;IAC5C;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAC7C,QAAQ,CACN,IAAI,CACF,YAAY,EACZ,YAAY,GAAG,qBAAqB,GAAG,cAAc,GAAG,aAAa,CACtE,CACF,CAAC;AAEJ,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,oBAAoB,EAAE,CAAC;IACnC,kEAAkE;IAClE,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;IAC5C,oEAAoE;IACpE,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,wCAAwC;IACxC,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,YAAY,CAAC;AAErD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aemvite/aem-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Typed config helper, loader, and Vite build orchestrator for AEM clientlib packages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aem",
|
|
@@ -52,9 +52,10 @@
|
|
|
52
52
|
"prepublishOnly": "npm run build"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@aemvite/vite-plugin-aem-clientlib": "^0.
|
|
56
|
-
"@aemvite/vite-plugin-aem-
|
|
57
|
-
"@aemvite/vite-plugin-
|
|
55
|
+
"@aemvite/vite-plugin-aem-clientlib": "^0.5.0",
|
|
56
|
+
"@aemvite/vite-plugin-aem-css-url-passthrough": "^0.5.0",
|
|
57
|
+
"@aemvite/vite-plugin-aem-resources": "^0.5.0",
|
|
58
|
+
"@aemvite/vite-plugin-glob": "^0.5.0"
|
|
58
59
|
},
|
|
59
60
|
"peerDependencies": {
|
|
60
61
|
"esbuild": "^0.28",
|