vendure-config.hbs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. {{#if isTs }}import{{ else }}const{{/if}} {
  2. fakePalPaymentHandler,
  3. gripePaymentHandler,
  4. defaultEmailTypes,
  5. HandlebarsMjmlGenerator,
  6. DefaultAssetServerPlugin,
  7. DefaultSearchPlugin,
  8. {{#if isTs}}VendureConfig,{{/if}}
  9. } {{#if isTs}}from 'vendure'; {{ else }}= require('vendure');{{/if}}
  10. {{#if isTs }}
  11. import * as path from 'path';
  12. {{ else }}
  13. const path = require('path');
  14. {{/if}}
  15. {{#if isTs}}export {{/if}}const config{{#if isTs}}: VendureConfig{{/if}} = {
  16. defaultChannelToken: 'default-channel',
  17. authOptions: {
  18. sessionSecret: '{{ sessionSecret }}',
  19. },
  20. port: 3000,
  21. apiPath: 'api',
  22. dbConnectionOptions: {
  23. type: '{{ dbType }}',
  24. synchronize: true, // turn this off for production
  25. logging: false,
  26. database: '{{ dbName }}',
  27. {{#if isSQLite}}
  28. {{else}}
  29. host: '{{ dbHost }}',
  30. port: {{ dbPort }},
  31. username: '{{ dbUserName }}',
  32. password: '{{ dbPassword }}',
  33. {{/if}}
  34. },
  35. paymentOptions: {
  36. paymentMethodHandlers: [fakePalPaymentHandler, gripePaymentHandler],
  37. },
  38. customFields: {},
  39. emailOptions: {
  40. emailTypes: defaultEmailTypes,
  41. generator: new HandlebarsMjmlGenerator(path.join(__dirname, 'vendure', 'email', 'templates', 'partials')),
  42. transport: {
  43. type: 'file',
  44. outputPath: path.join(__dirname, 'vendure', 'email', 'test-emails'),
  45. },
  46. },
  47. importExportOptions: {
  48. importAssetsDir: path.join(__dirname, 'vendure', 'import-assets'),
  49. },
  50. plugins: [
  51. new DefaultAssetServerPlugin({
  52. route: 'assets',
  53. assetUploadDir: path.join(__dirname, 'vendure', 'assets'),
  54. port: 4000,
  55. hostname: 'http://localhost',
  56. previewMaxHeight: 1600,
  57. previewMaxWidth: 1600,
  58. presets: [
  59. { name: 'tiny', width: 50, height: 50, mode: 'crop' },
  60. { name: 'thumb', width: 150, height: 150, mode: 'crop' },
  61. { name: 'small', width: 300, height: 300, mode: 'resize' },
  62. { name: 'medium', width: 500, height: 500, mode: 'resize' },
  63. { name: 'large', width: 800, height: 800, mode: 'resize' },
  64. ],
  65. }),
  66. new DefaultSearchPlugin(),
  67. ],
  68. };
  69. {{#if isTs}}
  70. {{else}}
  71. module.exports = { config };
  72. {{/if}}