-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathuvue.config.js
47 lines (47 loc) · 1.2 KB
/
uvue.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
export default {
// UVue plugins
plugins: [
// Add middlewares system
[
'@uvue/core/plugins/middlewares',
{
middlewares: [
/**
* If user come to this application we check is already logged.
* Result will be stored in Vuex to be used anywhere in Vue application.
*/
async ({ store, $http }) => {
try {
const { data } = await $http.get('/api/profile');
store.commit('setUser', data);
} catch (err) {
// Nothing here...
}
},
],
},
],
// Add asyncData() process to page components
'@uvue/core/plugins/asyncData',
// Vuex plugin
[
'@uvue/core/plugins/vuex',
{
onHttpRequest: true,
fetch: true,
},
],
// Catch errors
'@uvue/core/plugins/errorHandler',
// Clear errors on routes changes
'@/plugins/errorClear',
// HTTP client to get data from API
'@/plugins/httpClient',
// Show a progress bar on routes changes
'@/plugins/navLoader',
// Show a loader for SPA pages
'@/plugins/spaLoader',
// Web fonts loader
'@/plugins/webFonts',
],
};