Skip to content

Commit

Permalink
Fix unreplaced CSP policy value due to sed command in package.sh (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
nlydv authored Feb 1, 2022
1 parent 31f9f59 commit ee43daa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
mkdir -p ./dist
cp app/app.html dist
CSP_POLICY="default-src 'self'; style-src 'self' 'sha256-GhG3bE0iJoXJDtzwjDYe4ewzpUCrcbsJVwiqGhTOAVg=' https:\/\/fonts.googleapis.com; font-src https:\/\/fonts.gstatic.com; img-src * data:; connect-src http:\/\/localhost:13037 http:\/\/localhost:13039 http:\/\/localhost:14037 http:\/\/localhost:14039 http:\/\/localhost:15037 http:\/\/localhost:15039 http:\/\/localhost:12037 http:\/\/localhost:12039 https:\/\/*.sentry.io https:\/\/*.mixpanel.com;"
sed -i "s/{{cspValue}}/${CSP_POLICY}/g" dist/app.html
sed -i.tmp "s/{{cspValue}}/${CSP_POLICY}/g" dist/app.html
rm dist/app.html.tmp
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../"
NODE_ENV=production $DIR/node_modules/.bin/webpack --config ./configs/webpack.config.renderer.prod.babel.js --colors
$DIR/node_modules/.bin/babel $DIR/app/main.js -o ./dist/main.js
Expand Down

0 comments on commit ee43daa

Please sign in to comment.