1
1
const DEBUG = process . env . NODE_ENV !== 'production'
2
- const APP_NAME = 'Nuxify'
3
- const APP_DESCRIPTION = "Writing Software Like It's Ours"
4
- const APP_URL = 'http://localhost:3000'
5
-
6
- const API_URL = DEBUG
7
- ? 'https://jsonplaceholder.typicode.com'
8
- : 'https://jsonplaceholder.typicode.com'
9
2
10
3
export default {
11
- target : 'static' ,
12
4
ssr : true ,
5
+ target : 'static' ,
6
+ server : {
7
+ port : process . env . APP_PORT ,
8
+ host : process . env . APP_HOST ,
9
+ } ,
13
10
/*
14
11
** Headers of the page
15
12
*/
16
13
head : {
17
- titleTemplate : '%s - ' + APP_NAME ,
18
- title : APP_NAME || '' ,
14
+ titleTemplate : '%s - ' + process . env . APP_NAME ,
15
+ title : process . env . APP_NAME || '' ,
19
16
meta : [
20
17
{ charset : 'utf-8' } ,
21
18
{ name : 'viewport' , content : 'width=device-width, initial-scale=1' } ,
22
19
{
23
20
hid : 'description' ,
24
21
name : 'description' ,
25
- content : APP_DESCRIPTION || '' ,
22
+ content : process . env . APP_DESCRIPTION || '' ,
26
23
} ,
27
24
// OG Tag setup
28
25
// https://vue-meta.nuxtjs.org/api/#meta
@@ -33,27 +30,27 @@ export default {
33
30
} ,
34
31
{
35
32
property : 'og:title' ,
36
- content : APP_NAME ,
33
+ content : process . env . APP_NAME ,
37
34
vmid : 'og:title' ,
38
35
} ,
39
36
{
40
37
property : 'og:description' ,
41
- content : APP_DESCRIPTION ,
38
+ content : process . env . APP_DESCRIPTION ,
42
39
vmid : 'og:description' ,
43
40
} ,
44
41
{
45
42
property : 'og:site_name' ,
46
- content : APP_URL ,
43
+ content : process . env . APP_URL ,
47
44
vmid : 'og:site_name' ,
48
45
} ,
49
46
{
50
47
property : 'og:url' ,
51
- content : APP_URL ,
48
+ content : process . env . APP_URL ,
52
49
vmid : 'og:url' ,
53
50
} ,
54
51
{
55
52
property : 'og:image' ,
56
- content : APP_URL + '/icon.png' ,
53
+ content : process . env . APP_URL + '/icon.png' ,
57
54
vmid : 'og:image' ,
58
55
} ,
59
56
] ,
@@ -97,23 +94,31 @@ export default {
97
94
// Doc: https://axios.nuxtjs.org/usage
98
95
'@nuxtjs/axios' ,
99
96
'@nuxtjs/pwa' ,
100
- // Doc: https://github.com/nuxt-community/dotenv-module
101
- '@nuxtjs/dotenv' ,
102
97
[ 'vue-scrollto/nuxt' , { duration : 1000 } ] ,
103
98
] ,
99
+ /**
100
+ * Public runtime configs
101
+ */
102
+ publicRuntimeConfig : {
103
+ appName : process . env . APP_NAME ,
104
+ } ,
105
+ /**
106
+ * Private runtime configs
107
+ */
108
+ privateRuntimeConfig : { } ,
104
109
/**
105
110
* PWA module configuration
106
111
* https://pwa.nuxtjs.org/setup.html
107
112
*/
108
113
pwa : {
109
114
meta : {
110
- title : APP_NAME ,
115
+ title : process . env . APP_NAME ,
111
116
} ,
112
117
manifest : {
113
- name : APP_NAME ,
114
- short_name : APP_NAME ,
115
- description : APP_DESCRIPTION ,
116
- start_url : APP_URL ,
118
+ name : process . env . APP_NAME ,
119
+ short_name : process . env . APP_NAME ,
120
+ description : process . env . APP_DESCRIPTION ,
121
+ start_url : process . env . APP_URL ,
117
122
lang : 'en' ,
118
123
} ,
119
124
} ,
@@ -122,7 +127,7 @@ export default {
122
127
** See https://axios.nuxtjs.org/options
123
128
*/
124
129
axios : {
125
- baseURL : API_URL ,
130
+ baseURL : process . env . API_URL ,
126
131
debug : DEBUG ,
127
132
} ,
128
133
/*
0 commit comments