-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
140 lines (128 loc) · 2.95 KB
/
nuxt.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// if (process.env.NODE_ENV !== 'production') require('appmetrics-dash').attach({url: '/metrics', title: 'Nuxt.js'});
const pkg = require('./package');
require('dotenv').config();
const host = process.env.HOST || 'localhost';
const graph = 'http://' + host + ':4000/graphql';
module.exports = {
env: {
graphServer: graph,
graphClient: (process.env.BASE_URL && !process.env.BASE_URL.includes(host) ? process.env.BASE_URL + '/graphql' : graph),
dev: process.env.NODE_ENV !== 'production',
},
// mode: 'universal',
srcDir: './src/client/',
modern: true,
server: {
host: host,
port: process.env.PORT || (process.env.dev ? 8000 : 3000),
},
router: {
prefetchLinks: !process.env.dev,
},
/*serverMiddleware: [
{path: '/graphql', handler: '../server/apollo/middleware.js'},
],*/
/*css: [
'~/assets/style/app.styl'
],*/
loading: {color: '#f00'},
head: {
//title: pkg.name,
titleTemplate: '%s | ' + pkg.name,
meta: [
{charset: 'utf-8'},
{name: 'viewport', content: 'width=device-width, initial-scale=1'},
{hid: 'description', name: 'description', content: pkg.description}
],
link: [
{rel: 'icon', type: 'image/x-icon', href: '/favicon.ico'},
{
rel: 'stylesheet',
href:
'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons'
}
]
},
generate: {
//dir: 'docs',
routes: require('./src/routes/dynamic'),
},
plugins: [
//'@/plugins/vuetify',
'@/plugins/filters',
'@/plugins/mixins',
//'@/plugins/googlemaps',
//'@/plugins/eventbus',
'@/plugins/gql.js',
],
buildModules: [
'@nuxtjs/vuetify',
'@aceforth/nuxt-optimized-images',
//['@nuxtjs/localtunnel', {subdomain: 'ingoa'}],
],
modules: [
'@nuxtjs/amp',
'@nuxtjs/apollo',
'@nuxtjs/dotenv',
'@nuxtjs/pwa',
//'@nuxtjs/sitemap',
'@nuxtjs/webpackmonitor',
'@nuxtjs/robots',
//['@nuxtjs/feed', {}],
/*['@nuxtjs/google-analytics', {
id: 'UA-45273295-4'
}],*/
//'nuxt-helmet',
'nuxt-leaflet',
'nuxt-trailingslash-module',
[
'nuxt-i18n',
{
strategy: 'prefix_except_default',
defaultLocale: 'en',
lazy: true,
langDir: 'locales/',
locales: require('./src/client/locales.json'),
parsePages: false,
pages: require('./src/routes/pages'),
},
],
],
optimizedImages: {
inlineImageLimit: -1,
imagesName: () => '[path][name].[ext]',
//optimizeImagesInDev: true,
},
apollo: {
includeNodeModules: true,
clientConfigs: {
default: '@/plugins/apollo.js'
},
},
build: {
//transpile: [/^vue2-google-maps($|\/)/],
extractCSS: true,
optimizeCSS: true,
extend(config, ctx) {
if (ctx.isDev) {
config.devtool = ctx.isClient ? 'source-map' : 'inline-source-map';
}
},
/* filenames: {
img: () => '[path][name].[ext]',
}, */
/*babel: {
presets({isServer}) {
return [
[
require.resolve('@nuxt/babel-preset-app'),
{
buildTarget: isServer ? 'server' : 'client',
corejs: {version: 3}
}
]
];
}
}*/
}
};