This repository has been archived by the owner on Jun 23, 2023. It is now read-only.
forked from top-comengineer/Devcash-Bounty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
125 lines (125 loc) · 3.29 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
module.exports = {
telemetry: false,
mode: "universal",
/*
** Headers of the page
*/
head: {
title: process.env.npm_package_name || "",
meta: [
{ charset: "utf-8" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{
hid: "description",
name: "description",
content: process.env.npm_package_description || ""
}
],
link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
},
/*
** Customize the progress-bar color
*/
loading: { color: "#675CFF" },
/*
** Global CSS
*/
css: ["@/assets/css/main.scss"],
/*
** Plugins to load before mounting the App
*/
plugins: [
{ src: '~/plugins/vue-qr.js', ssr: false },
{ src: '~/plugins/devcash/devcashBounty.client.js', ssr: false },
{ src: '~/plugins/crontab.js', ssr: false },
{ src: '~/plugins/notifications.js', ssr: false},
{ src: '~/plugins/scrollTo.js', ssr: false},
'~/plugins/disqus',
'~/plugins/sanitizeHtml'
],
/*
** Nuxt.js dev-modules
*/
buildModules: [
// Doc: https://github.com/nuxt-community/nuxt-tailwindcss
"@nuxtjs/tailwindcss"
],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://axios.nuxtjs.org/usage
"@nuxtjs/axios",
[
'nuxt-i18n',
{
strategy: "prefix_and_default",
baseUrl: (c) => {
if (process.server) {
const { req } = c
let proto = req.get('x-forwarded-proto') ? req.get('x-forwarded-proto') : req.protocol
let host = req.get('x-forwarded-host') ? req.get('x-forwarded-host') : req.get('host')
return proto + '://' + host
}
return window.location.protocol + "//" + window.location.host;
},
seo: false,
locales: [
{
code: "en",
iso: "en",
name: "English",
file: 'en.json'
},
/*
{
code: "zhHans",
iso: "zh-Hans",
name: "简化字",
file: 'zh-Hans.json'
}*/
],
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'i18n_redirected',
alwaysRedirect: true,
fallbackLocale: 'en'
},
lazy: true,
defaultLocale: 'en',
langDir: 'locales/',
vueI18n: { fallbackLocale: 'en' }
}
]
],
/*
** Axios module configuration
** See https://axios.nuxtjs.org/options
*/
axios: {
baseURL: process.env.NUXT_ENV_APP_URL || 'http://localhost:3000'
},
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) { },
filenames: {
app: ({ isDev }) => (isDev ? "[name].js" : "[name].[chunkhash].js"),
chunk: ({ isDev }) => (isDev ? "[name].js" : "[name].[chunkhash].js"),
css: ({ isDev }) => (isDev ? "[name].css" : "[name].[contenthash].css"),
img: ({ isDev }) =>
isDev ? "[path][name].[ext]" : "img/[name].[hash:7].[ext]",
font: ({ isDev }) =>
isDev ? "[path][name].[ext]" : "fonts/[name].[hash:7].[ext]",
video: ({ isDev }) =>
isDev ? "[path][name].[ext]" : "videos/[name].[hash:7].[ext]"
}
},
router: {
middleware: ['theme', 'devcash', 'baseurl']
}
};