Files
badger/www/nuxt.config.js

159 lines
4.0 KiB
JavaScript

export default {
ssr: true,
/*
** Nuxt target
** See https://nuxtjs.org/api/configuration-target
*/
target: "server",
/*
** Headers of the page
** See https://nuxtjs.org/api/configuration-head
*/
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 ||
"Count and display your Github repo page access in seconds"
}
],
link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }]
},
/*
** Global CSS
*/
css: [],
/*
** Plugins to load before mounting the App
** https://nuxtjs.org/guide/plugins
*/
plugins: [
{ src: "~plugins/ga.js", mode: "client" },
{ src: "~plugins/axios.js", mode: "client" }
],
/*
** Auto import components
** See https://nuxtjs.org/api/configuration-components
*/
components: true,
/*
** Nuxt.js dev-modules
*/
buildModules: ["@nuxt/typescript-build"],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://bootstrap-vue.js.org
"bootstrap-vue/nuxt",
// "@nuxt/http",
// Doc: https://axios.nuxtjs.org/usage
"@nuxtjs/auth-next",
"@nuxtjs/axios",
"@nuxtjs/pwa"
// 'nuxt-i18n',
// Doc: https://github.com/nuxt/content
// '@nuxt/content',
],
// http: {
// proxy: true // Can be also an object with default options
// },
proxy: {
"/api/":
process.env.NODE_ENV === "production"
? "https://badges.toozhao.com"
: "http://localhost:8080"
},
publicRuntimeConfig: {
env: process.env.NODE_ENV,
baseURL: process.env.BASE_URL || "http://localhost:3000",
backendURL:
process.env.NODE_ENV === "production"
? "https://badges.toozhao.com"
: "http://localhost:8080",
myBadge:
process.env.NODE_ENV === "production"
? "https://badges.toozhao.com/badges/01EGTQ64XK7M48A67K9Y62J0QZ"
: "http://localhost:8080/badges/01EGTQ3JBFYS7VZG36SBPM0SA9",
myStats:
process.env.NODE_ENV === "production"
? "https://badges.toozhao.com/stats/01EGTQ64XK7M48A67K9Y62J0QZ"
: "http://localhost:3000/stats/01EGTQ3JBFYS7VZG36SBPM0SA9"
},
/*
** Axios module configuration
** See https://axios.nuxtjs.org/options
*/
axios: {
proxy: true
},
/*
** Content module configuration
** See https://content.nuxtjs.org/configuration
*/
// i18n: {
// locales: ['en', 'zh-CN'],
// },
content: {},
/*
** Build configuration
** See https://nuxtjs.org/api/configuration-build/
*/
build: {
// babel: {
// compact: true
// }
},
auth: {
redirect: {
callback: "/callback",
logout: "/signed-out"
},
strategies: {
github: process.env.NODE_ENV !== "production" ? {
clientId: "e5f10ed97cf95f71c5b7",
clientSecret: "8543545533ca899c8d9b40b89c3685202c8eb683"
} : {
clientId: "1af9be810121e3b2c9cd",
clientSecret: "a521740b1ea218d82e05748d6815f3cb0f900ee9"
},
local: {
token: {
property: "token.accessToken"
}
},
localRefresh: {
scheme: "refresh",
token: {
property: "token.accessToken",
maxAge: 15
},
refreshToken: {
property: "token.refreshToken",
data: "refreshToken",
maxAge: false
}
}
}
},
server: {
port: 3000,
host: '0.0.0.0'
},
bootstrapVue: {
// Install the `IconsPlugin` plugin (in addition to `BootstrapVue` plugin)
icons: false,
components: ['BContainer', 'BRow', 'BCol', 'BFormInput', 'BButton', 'BTable', 'BModal', 'BCard',
'BLink', 'BCardText', 'BFormTextarea', 'BImg', 'BDropdownItem', 'BOverlay', 'BNavbar', 'BNavbarBrand',
'BNavbarToggle', 'BCollapse', 'BNavbarNav', 'BNavItem', 'BNavItemDropdown', 'BButtonGroup', 'BAlert']
}
// router: {
// middleware: ['auth']
// }
};