Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
habib/DPROD-2967/Attestation-check-on-topics (#6550)
Browse files Browse the repository at this point in the history
* chore: update htaccess file

* chore: update .htaccess file
  • Loading branch information
habib-deriv authored Jan 26, 2024
1 parent 5cfdbf1 commit 931987e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<IfModule mod_headers.c>
Header set Cache-Control "public, max-age=31536000, immutable"
Header set Permissions-Policy "browsing-topics=()"
</IfModule>
6 changes: 0 additions & 6 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ module.exports = {
`https://widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js`,
],
plugins: [
// [TODO] Enable this when we have a proper setup to enable caching, Otherwise it will cause one of them stop working.
// resolve: `gatsby-plugin-offline`,
// options: {
// // precachePages: [`/`],
// },
// },
'gatsby-plugin-postcss',
{
resolve: 'gatsby-plugin-html-minifier',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"license": "Apache License 2.0",
"scripts": {
"analyze-bundle": "GENERATE_JSON_STATS=true gatsby build && npx webpack-bundle-analyzer -m static -r ./webpack-bundle-report/report.html ./public/stats.json",
"build": "GATSBY_CPU_COUNT=2 gatsby build --log-pages",
"build": "GATSBY_CPU_COUNT=2 gatsby build --log-pages && node scripts/copy-htaccess.js",
"update:deriv-com-libs": "npm i @deriv-com/blocks@latest @deriv-com/components@latest @deriv-com/hooks@latest @deriv-com/providers@latest",
"partytown": "partytown copylib public/~partytown",
"develop": "GATSBY_CPU_COUNT=2 gatsby develop -o",
Expand Down
16 changes: 16 additions & 0 deletions scripts/copy-htaccess.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const fs = require('fs');
const path = require('path');

// Path to your custom .htaccess file in the project root
const htaccessPath = path.join(__dirname, '..', '.htaccess');

// Path to the Gatsby public directory
const publicPath = path.join(__dirname, '..', 'public', '.htaccess');

fs.copyFile(htaccessPath, publicPath, (err) => {
if (err) {
console.error('Error copying .htaccess file:', err);

Check warning on line 12 in scripts/copy-htaccess.js

View workflow job for this annotation

GitHub Actions / ESLint

scripts/copy-htaccess.js#L12

Unexpected console statement (no-console)
return;
}
console.log('.htaccess file copied successfully.');

Check warning on line 15 in scripts/copy-htaccess.js

View workflow job for this annotation

GitHub Actions / ESLint

scripts/copy-htaccess.js#L15

Unexpected console statement (no-console)
});

1 comment on commit 931987e

@vercel
Copy link

@vercel vercel bot commented on 931987e Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-com – ./

deriv-com.binary.sx
deriv-com-git-master.binary.sx

Please sign in to comment.