File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,18 @@ async function uploadAssets() {
110110 const type = f [ 1 ] ; // get integration name
111111 const integration = f [ 2 ] ; // get integration name
112112 const file = f [ f . length - 1 ] ;
113- const clientName = file . substring ( 0 , file . indexOf ( '.' ) ) ;
113+ /**
114+ * Supporting filenames where analytics.js is prepended to the bundle name.
115+ * Filename formats typically end in .js or .js.gz
116+ * For example:
117+ * - asfghemUtZGVkdXBsaWNhdGU.js.gz
118+ * - analytics.js-middleware-braze-foo.js
119+ * - analytics.js-middleware-braze-foo.js.gz
120+ * - analytics.js-middleware-braze-foo.dynamic.js.gz
121+ */
122+ const clientName = file . includes ( 'analytics.js-' ) ?
123+ file . substring ( 0 , file . lastIndexOf ( '.js' ) ) :
124+ file . substring ( 0 , file . indexOf ( '.' ) ) ;
114125 const bufferClientName = Buffer . from ( clientName ) . toString ( 'base64' ) . replace ( / = / g, '' ) ;
115126 const bufferFile = file . replace ( clientName , bufferClientName ) ;
116127
You can’t perform that action at this time.
0 commit comments