-
Notifications
You must be signed in to change notification settings - Fork 6
/
gridsome.config.js
34 lines (29 loc) · 975 Bytes
/
gridsome.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// This is where project configuration and plugin options are located.
// Learn more: https://gridsome.org/docs/config
// Changes here require a server restart.
// To restart press CTRL + C in terminal and run `gridsome develop`
const moltin = require('./config/moltin');
const algolia = require('./config/algolia');
const configureWebpack = require('./config/webpack');
const plugins = [moltin];
// Only load the Algolia plugin:
if (
// 1. during production builds;
process.env.NODE_ENV === 'production'
// 2. if credentials are in the environment.
&& ['ALGOLIA_APP_ID', 'ALGOLIA_ADMIN_KEY']
.every((key) => typeof process.env[key] === 'string' && process.env[key].length >= 10)
) {
plugins.push(algolia);
}
module.exports = {
siteName: 'Bright',
configureWebpack,
plugins,
templates: {
MoltinBrand: '/brand/:slug',
MoltinCategory: '/category/:slug',
MoltinCollection: '/collection/:slug',
MoltinProduct: '/product/:slug',
},
};