Skip to content

Commit d44cb17

Browse files
Conditionally load tracker-lookup.json for building (#477)
1 parent ce801bc commit d44cb17

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/utils/build.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,13 @@ export async function rollupScript (params) {
8282
supportsMozProxies = false
8383
} = params
8484

85-
const trackerLookupData = readFileSync('./build/tracker-lookup.json', 'utf8')
8685
const extensions = ['firefox', 'chrome', 'chrome-mv3']
87-
const trackerLookup = extensions.includes(platform) ? '$TRACKER_LOOKUP$' : trackerLookupData
86+
const isExtension = extensions.includes(platform)
87+
let trackerLookup = '$TRACKER_LOOKUP$'
88+
if (!isExtension) {
89+
const trackerLookupData = readFileSync('./build/tracker-lookup.json', 'utf8')
90+
trackerLookup = trackerLookupData
91+
}
8892
// The code is using a global, that we define here which means once tree shaken we get a browser specific output.
8993
const mozProxies = supportsMozProxies
9094
const plugins = [

0 commit comments

Comments
 (0)