-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathnuxt.config.js
106 lines (106 loc) · 2.97 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
export default {
ssr: false,
srcDir: "src/app/frontend/",
head: {
title: process.env.npm_package_name || "",
meta: [
{ charset: "utf-8" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{ name: "description", content: process.env.npm_package_description || "", hid: "description"},
],
link: [
{ rel: "icon", type: "image/svg+xml", href: "/favicon.svg" },
{ rel: "stylesheet", href: "https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700",},
],
bodyAttrs: {
class: "hold-transition sidebar-mini layout-fixed",
},
},
css: [
"@fortawesome/fontawesome-free/css/all.css",
"~/plugins/adminLte/css/adminlte.min.css",
"~/assets/css/app.css",
],
router: {
middleware: ["auth"]
},
plugins: [
{ src: "~/plugins/mixin-common-methods", mode: "client" },
{ src: "~/plugins/mixin-viewpage", mode: "client" },
{ src: "~/plugins/admin-lte", mode: "client" },
{ src: '~/plugins/axios', mode: "client" },
{ src: '~/plugins/storage', mode: "client" }
],
buildModules: ["@nuxt/typescript-build"],
modules: ["bootstrap-vue/nuxt", "@nuxtjs/axios", "cookie-universal-nuxt","@nuxtjs/auth-next"],
bootstrapVue: {
bootstrapCSS: false,
icons: true,
},
axios: {
baseURL: "/",
credentials: true,
headers: {
common: { "Accept": "application/json"}
}
},
auth: {
redirect: {
login: "/login", //User will be redirected to this path if login is required.
logout: "/login", //User will be redirected to this path if after logout, current route is protected.
home: "/" //User will be redirected to this path after login. (rewriteRedirects will rewrite this path)
},
localStorage: {
prefix: false // false or "auth."
},
cookie: {
prefix: "auth."
},
strategies: {
cookie: {
user: {
property: "user"
},
endpoints: {
login: { url: "/api/auth/login", method: "POST" },
logout: { url: "/api/auth/logout", method: "GET" },
user: { url: '/api/auth/user', method: "GET" },
}
},
local: {
scheme: "refresh",
token: {
property: 'token',
maxAge: 60 * 15,
type: false
},
refreshToken: {
property: 'refreshToken',
data: 'refreshToken',
maxAge: 60 * 60 * 24 * 7
},
user: {
property: 'user'
},
endpoints: {
login: { url: "/api/auth/login", method: "POST" },
logout: { url: "/api/auth/logout", method: "GET" },
refresh: { url: '/api/auth/token/refresh', method: "POST" },
user: { url: '/api/auth/user', method: "GET" },
}
}
}
},
publicRuntimeConfig: {
nodeEnv: process.env.NODE_ENV, // production or development
backendPort: process.env.BACKEND_PORT || "3001", // only development mode
terminalPort: process.env.TERMINAL_PORT || "3003", // only development mode
version: JSON.stringify(require('./package.json').version)
},
build: {
extend(config, ctx) {},
babel: {
compact: true, // for build ERROR "bootstrap-vue icons.js as it exceeds the max of 500KB."
},
},
};