Skip to content

Commit 5d1ca50

Browse files
Improve file annotation to include the inject name (#2003)
* Improve file annotation to include the inject name to make debugging easier * Lint fix
1 parent 03fc577 commit 5d1ca50

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

injected/scripts/utils/build.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { commentPlugin } from './comment-plugin.js';
77
const ROOT = join(cwd(import.meta.url), '..', '..');
88
const DEBUG = false;
99

10-
const prefixMessage = '/*! © DuckDuckGo ContentScopeScripts protections https://github.com/duckduckgo/content-scope-scripts/ */';
10+
const prefixMessage = '/*! © DuckDuckGo ContentScopeScripts $INJECT_NAME$ https://github.com/duckduckgo/content-scope-scripts/ */';
1111

1212
/**
1313
* @param {object} params
@@ -30,6 +30,8 @@ export async function bundle(params) {
3030
const loadFeaturesPlugin = loadFeatures(platform, featureNames);
3131
// The code is using a global, that we define here which means once tree shaken we get a browser specific output.
3232

33+
const outputPrefixName = prefixMessage.replace('$INJECT_NAME$', platform);
34+
3335
/** @type {import("esbuild").BuildOptions} */
3436
const buildOptions = {
3537
entryPoints: [scriptPath],
@@ -52,7 +54,7 @@ export async function bundle(params) {
5254
},
5355
plugins: [loadFeaturesPlugin, commentPlugin()],
5456
banner: {
55-
js: prefixMessage,
57+
js: outputPrefixName,
5658
},
5759
};
5860

0 commit comments

Comments
 (0)