@@ -43,18 +43,28 @@ const builds = {
43
43
async function initOther ( injectScriptPath , platformName ) {
44
44
const supportsMozProxies = platformName === 'firefox'
45
45
const identName = `inject${ camelcase ( platformName ) } `
46
- const injectScript = await rollupScript ( injectScriptPath , identName , supportsMozProxies )
46
+ const injectScript = await rollupScript ( {
47
+ scriptPath : injectScriptPath ,
48
+ name : identName ,
49
+ supportsMozProxies,
50
+ platform : platformName
51
+ } )
47
52
const outputScript = injectScript
48
53
return outputScript
49
54
}
50
55
51
56
/**
52
57
* @param {string } entry
58
+ * @param {string } platformName
53
59
*/
54
- async function initChrome ( entry ) {
60
+ async function initChrome ( entry , platformName ) {
55
61
const replaceString = '/* global contentScopeFeatures */'
56
- const injectScript = await rollupScript ( entry )
57
- const contentScope = await rollupScript ( contentScopePath , contentScopeName )
62
+ const injectScript = await rollupScript ( { scriptPath : entry , platform : platformName } )
63
+ const contentScope = await rollupScript ( {
64
+ scriptPath : contentScopePath ,
65
+ name : contentScopeName ,
66
+ platform : platformName
67
+ } )
58
68
// Encode in URI format to prevent breakage (we could choose to just escape ` instead)
59
69
// NB: .replace(/\r\n/g, "\n") is needed because in Windows rollup generates CRLF line endings
60
70
const encodedString = encodeURI ( contentScope . toString ( ) . replace ( / \r \n / g, '\n' ) )
@@ -74,7 +84,7 @@ async function init () {
74
84
75
85
let output
76
86
if ( args . platform === 'chrome' ) {
77
- output = await initChrome ( build . input )
87
+ output = await initChrome ( build . input , args . platform )
78
88
} else {
79
89
output = await initOther ( build . input , args . platform )
80
90
}
0 commit comments