Skip to content

Commit a4b87ab

Browse files
authored
chore: Add source map to prod build output and CDN. (#96)
1 parent af7b078 commit a4b87ab

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

.github/scripts/deploy.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,21 @@ bucket=$1
66
echo ::set-output name=current-version::$version
77

88
aws s3api put-object --bucket $bucket --key "content/$version/cwr.js" --body build/assets/cwr.js --cache-control max-age=604800
9+
aws s3api put-object --bucket $bucket --key "content/$version/cwr.js.map" --body build/assets/cwr.js.map --cache-control max-age=604800
910
aws s3api put-object --bucket $bucket --key "content/$version/LICENSE-THIRD-PARTY" --body LICENSE-THIRD-PARTY --cache-control max-age=604800
1011
aws s3api put-object --bucket $bucket --key "content/$version/LICENSE" --body LICENSE --cache-control max-age=604800
1112

1213
if [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]
1314
then
1415
minorUpdate=$(echo $version | sed -En "s/^([0-9]+\.)[0-9]+\.[0-9]+/\1x/p")
1516
aws s3api put-object --bucket $bucket --key "content/$minorUpdate/cwr.js" --body build/assets/cwr.js --cache-control max-age=7200
17+
aws s3api put-object --bucket $bucket --key "content/$minorUpdate/cwr.js.map" --body build/assets/cwr.js.map --cache-control max-age=7200
1618
aws s3api put-object --bucket $bucket --key "content/$minorUpdate/LICENSE-THIRD-PARTY" --body LICENSE-THIRD-PARTY --cache-control max-age=7200
1719
aws s3api put-object --bucket $bucket --key "content/$minorUpdate/LICENSE" --body LICENSE --cache-control max-age=7200
20+
1821
patchUpdate=$(echo $version | sed -En "s/^([0-9]+\.[0-9]+\.)[0-9]+/\1x/p")
1922
aws s3api put-object --bucket $bucket --key "content/$patchUpdate/cwr.js" --body build/assets/cwr.js --cache-control max-age=7200
23+
aws s3api put-object --bucket $bucket --key "content/$patchUpdate/cwr.js.map" --body build/assets/cwr.js.map --cache-control max-age=7200
2024
aws s3api put-object --bucket $bucket --key "content/$patchUpdate/LICENSE-THIRD-PARTY" --body LICENSE-THIRD-PARTY --cache-control max-age=7200
2125
aws s3api put-object --bucket $bucket --key "content/$patchUpdate/LICENSE" --body LICENSE --cache-control max-age=7200
2226
fi

webpack/webpack.prod.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const TerserPlugin = require('terser-webpack-plugin');
55

66
module.exports = merge(common, {
77
mode: 'production',
8+
devtool: 'hidden-source-map',
89
optimization: {
910
minimizer: [
1011
new TerserPlugin({

0 commit comments

Comments
 (0)