Skip to content

Commit

Permalink
refactor: nuxt.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgurg committed Mar 16, 2024
1 parent adf1e50 commit b71c2d6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import fs from "fs";
import path from "path";
import tr from "vuetify/es5/locale/tr";

let cspNonce = "development-mode";
const cspNonceTxtPath = path.join(__dirname, "csp-nonce.txt");
const cspNonceTxt = fs.existsSync(cspNonceTxtPath);
if (cspNonceTxt) {
// create-csp-nonce-txt.js
cspNonce = fs.readFileSync(cspNonceTxtPath, { encoding: "utf-8" });
}
const isCspNonceTxtExists = fs.existsSync(cspNonceTxtPath);
const cspNonce = isCspNonceTxtExists ?
fs.readFileSync(cspNonceTxtPath, { encoding: "utf-8" }) :
"development-mode";

export default {
target: "static",
Expand Down

0 comments on commit b71c2d6

Please sign in to comment.