Skip to content

Commit 0398794

Browse files
Abhishek Bindraclaude
andcommitted
feat(build): support A11Y_FINGERPRINT_PATH env var for fingerprint module override
Allow overriding the fingerprint module path via environment variable, useful for non-standard monorepo layouts or custom build environments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 94cca81 commit 0398794

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

build/tasks/esbuild.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@ const fs = require('fs');
44

55
// [a11y-core]: resolve ip-protection imports to real file in monorepo,
66
// or fall back to a stub when building axe-core standalone (CI).
7+
// Set A11Y_FINGERPRINT_PATH env var to override the fingerprint module location.
78
const fingerprintFallback = {
89
name: 'a11y-fingerprint-fallback',
910
setup(pluginBuild) {
1011
pluginBuild.onResolve(
1112
{ filter: /ip-protection\/utils\/fingerprint/ },
1213
args => {
14+
if (process.env.A11Y_FINGERPRINT_PATH) {
15+
const envPath = path.resolve(process.env.A11Y_FINGERPRINT_PATH);
16+
if (fs.existsSync(envPath)) {
17+
return { path: envPath };
18+
}
19+
}
1320
const realPath = path.resolve(args.resolveDir, args.path + '.js');
1421
if (fs.existsSync(realPath)) {
1522
return { path: realPath };

0 commit comments

Comments
 (0)