Browse Source

set default nvm version and fix nuxt config for non-dev env

Olivier Massot 2 years ago
parent
commit
3324ed078f
3 changed files with 12 additions and 5 deletions
  1. 1 0
      .nvmrc
  2. 1 1
      README.md
  3. 10 4
      nuxt.config.ts

+ 1 - 0
.nvmrc

@@ -0,0 +1 @@
+18.10

+ 1 - 1
README.md

@@ -79,7 +79,7 @@ Se placer dans le répertoire de l'application, puis lancer :
 
 Attention, sur les environnements de test, il faut utiliser nvm pour exécuter la bonne version de node, exemple :
 
-    nvm exec 18.10.0 yarn install
+    nvm exec yarn install
 
 
 ## Autres

+ 10 - 4
nuxt.config.ts

@@ -2,6 +2,15 @@ import fs from 'fs';
 import vuetify from 'vite-plugin-vuetify'
 import {NuxtI18nOptions} from "@nuxtjs/i18n"
 
+let https = {}
+
+if (process.env.NUXT_ENV === 'dev') {
+    https = {
+        key: fs.readFileSync('local.app-v3.opentalent.fr.key'),
+        cert: fs.readFileSync('local.app-v3.opentalent.fr.crt'),
+    }
+}
+
 /**
  * Nuxt configuration
  *
@@ -107,10 +116,7 @@ export default defineNuxtConfig({
             noExternal: ['vuetify']
         },
         server : {
-            https: {
-                key: fs.readFileSync('local.app-v3.opentalent.fr.key'),
-                cert: fs.readFileSync('local.app-v3.opentalent.fr.crt'),
-            },
+            https,
             //@ts-ignore
             port: 443,
             hmr: {