Browse Source

feat(create): Improve config defaults

Enables the latest features for the DefaultJobQueuePlugin and DefaultSearchPlugin, and exposes
the cookie secret setting, which closes #1147
Michael Bromley 4 years ago
parent
commit
e2f799c78b
1 changed files with 5 additions and 2 deletions
  1. 5 2
      packages/create/templates/vendure-config.hbs

+ 5 - 2
packages/create/templates/vendure-config.hbs

@@ -48,6 +48,9 @@ const path = require('path');
             identifier: '{{{ escapeSingle superadminIdentifier }}}',
             password: '{{{ escapeSingle superadminPassword }}}',
         },
+        cookieOptions: {
+          secret: process.env.COOKIE_SECRET || 'cookie-secret',
+        },
     },
     dbConnectionOptions: {
         type: '{{ dbType }}',
@@ -75,8 +78,8 @@ const path = require('path');
             route: 'assets',
             assetUploadDir: path.join(__dirname, '../static/assets'),
         }),
-        DefaultJobQueuePlugin,
-        DefaultSearchPlugin,
+        DefaultJobQueuePlugin.init({ useDatabaseForBuffer: true }),
+        DefaultSearchPlugin.init({ bufferUpdates: false, indexStockStatus: true }),
         EmailPlugin.init({
             devMode: true,
             outputPath: path.join(__dirname, '../static/email/test-emails'),