From 38d76e7b55c23e7ebaa889960618d121faf8405a Mon Sep 17 00:00:00 2001 From: Owen Pearson Date: Thu, 9 Jun 2022 14:13:19 +0100 Subject: [PATCH] Remove sourcemaps from cdn_deploy script --- scripts/cdn_deploy.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/scripts/cdn_deploy.js b/scripts/cdn_deploy.js index 462bd805a5..9b0d16ba3c 100755 --- a/scripts/cdn_deploy.js +++ b/scripts/cdn_deploy.js @@ -21,7 +21,7 @@ async function run() { // Comma separated directories (relative to `path`) to exclude from upload excludeDirs: 'node_modules,.git', // Regex to match files against for upload - fileRegex: '^ably(\\.noencryption)?(\\.min)?\\.js(\\.map)?', + fileRegex: '^ably(\\.noencryption)?(\\.min)?\\.js', ...argv, }; @@ -66,21 +66,14 @@ async function run() { file ); const split = relativePath.split('.js'); - const newPath = `${split[0]}-${version}.js${split[1]}`; + const newPath = `${split[0]}-${version}.js`; let fileData = fs.readFileSync(file).toString(); - let ContentType; - if (newPath.endsWith('.min.js')) { - fileData = fileData.replace('//# sourceMappingURL=ably.min.js.map', `//# sourceMappingURL=${newPath}.map`); - ContentType = 'application/json'; - } else { - ContentType = 'application/javascript'; - } await upload(s3, { Body: fileData, Key: path.join(config.root, newPath), Bucket: config.bucket, - ContentType, + ContentType: 'application/javascript', }); } }