api-client/nuxt.config.js

257 lines
5.9 KiB
JavaScript
Raw Normal View History

2019-08-24 03:06:57 +00:00
// Some helpful application constants.
// TODO: Use these when rendering the pages (rather than just for head/meta tags...)
2019-08-24 17:01:57 +00:00
export const meta = {
2019-08-24 03:06:57 +00:00
name: "Postwoman",
shortDescription: "API request builder",
2019-08-24 03:06:57 +00:00
description: "The Postwoman API request builder helps you create your requests faster, saving you precious time on your development."
};
// Sets the base path for the router.
// Important for deploying to GitHub pages.
// -- Travis includes the author in the repo slug,
// so if there's a /, we need to get everything after it.
2019-08-24 17:01:57 +00:00
let repoName = (process.env.TRAVIS_REPO_SLUG || '').split('/').pop();
export const routerBase = process.env.DEPLOY_ENV === 'GH_PAGES' ? {
router: {
2019-09-04 08:41:55 +00:00
base: `/${repoName}/`
}
2019-08-24 17:01:57 +00:00
} : {
router: {
base: '/'
}
};
2019-08-24 03:06:57 +00:00
export default {
mode: 'spa',
/*
2019-09-04 06:49:17 +00:00
** Headers of the page
*/
2019-08-24 03:06:57 +00:00
head: {
title: `${meta.name} \u2022 ${meta.shortDescription}`,
meta: [
2019-09-04 06:49:17 +00:00
{
charset: 'utf-8'
},
{
name: 'viewport',
content: 'width=device-width, initial-scale=1, minimum-scale=1, shrink-to-fit=no, minimal-ui'
},
{
hid: 'description',
name: 'description',
content: meta.description || ''
},
{
name: 'keywords',
content: 'postwoman, api, request, testing, tool, rest, websocket'
},
{
name: 'X-UA-Compatible',
content: "IE=edge, chrome=1"
},
{
itemprop: "name",
content: `${meta.name} \u2022 ${meta.shortDescription}`
},
{
itemprop: "description",
content: meta.description
},
{
itemprop: "image",
content: `${routerBase.router.base}icons/icon-192x192.png`
},
2019-08-24 03:06:57 +00:00
// Add to homescreen for Chrome on Android. Fallback for PWA (handled by nuxt)
2019-09-04 06:49:17 +00:00
{
name: 'application-name',
content: meta.name
},
2019-08-24 03:06:57 +00:00
// Add to homescreen for Safari on iOS
2019-09-04 06:49:17 +00:00
{
name: 'apple-mobile-web-app-capable',
content: 'yes'
},
{
name: 'apple-mobile-web-app-status-bar-style',
content: 'black-translucent'
},
{
name: 'apple-mobile-web-app-title',
content: meta.name
},
2019-08-24 03:06:57 +00:00
// Windows phone tile icon
2019-09-04 06:49:17 +00:00
{
name: 'msapplication-TileImage',
content: `${routerBase.router.base}icons/icon-144x144.png`
},
{
name: 'msapplication-TileColor',
content: '#282a36'
},
{
name: 'msapplication-tap-highlight',
content: 'no'
},
2019-08-24 03:06:57 +00:00
// OpenGraph
2019-09-04 06:49:17 +00:00
{
property: 'og:site_name',
content: meta.name
},
{
property: 'og:url',
content: 'https://liyasthomas.github.io/postwoman'
},
{
property: 'og:type',
content: 'website'
},
{
property: 'og:title',
content: `${meta.name} \u2022 ${meta.shortDescription}`
},
{
property: 'og:description',
content: meta.description
},
{
property: 'og:image',
content: `${routerBase.router.base}icons/icon-144x144.png`
},
2019-08-24 03:06:57 +00:00
// Twitter
2019-09-04 06:49:17 +00:00
{
name: 'twitter:card',
content: "summary"
},
{
name: 'twitter:site',
content: "@liyasthomas"
},
{
name: 'twitter:creator',
content: "@liyasthomas"
},
{
name: 'twitter:url',
content: "https://liyasthomas.github.io/postwoman"
},
{
name: 'twitter:title',
content: meta.name
},
{
name: 'twitter:description',
content: meta.shortDescription
},
{
name: 'twitter:image',
content: `${routerBase.router.base}icons/icon-144x144.png`
},
2019-08-24 03:06:57 +00:00
],
link: [
2019-09-04 06:49:17 +00:00
{
rel: 'icon',
type: 'image/x-icon',
href: '/favicon.ico'
},
2019-08-24 03:06:57 +00:00
// Home-screen icons (iOS)
2019-09-04 06:49:17 +00:00
{
rel: 'apple-touch-icon',
href: `${routerBase.router.base}icons/icon-48x48.png`
},
{
rel: 'apple-touch-icon',
sizes: '72x72',
href: `${routerBase.router.base}icons/icon-72x72.png`
},
{
rel: 'apple-touch-icon',
sizes: '96x96',
href: `${routerBase.router.base}icons/icon-96x96.png`
},
{
rel: 'apple-touch-icon',
sizes: '144x144',
href: `${routerBase.router.base}icons/icon-144x144.png`
},
{
rel: 'apple-touch-icon',
sizes: '192x192',
href: `${routerBase.router.base}icons/icon-192x192.png`
},
2019-08-24 03:06:57 +00:00
]
},
/*
2019-09-04 06:49:17 +00:00
** Customize the progress-bar color
*/
loading: {
color: 'var(--ac-color)'
},
2019-08-24 03:06:57 +00:00
/*
2019-09-04 06:49:17 +00:00
** Global CSS
*/
2019-08-24 03:06:57 +00:00
css: [
'@/assets/css/themes.scss',
2019-08-24 03:06:57 +00:00
'@/assets/css/fonts.scss',
'@/assets/css/styles.scss'
],
/*
2019-09-04 06:49:17 +00:00
** Plugins to load before mounting the App
*/
2019-08-24 03:06:57 +00:00
plugins: [
2019-09-04 06:49:17 +00:00
{
src: '~/plugins/vuex-persist'
}
2019-08-24 03:06:57 +00:00
],
/*
2019-09-04 06:49:17 +00:00
** Nuxt.js dev-modules
*/
2019-08-24 03:06:57 +00:00
buildModules: [
],
/*
2019-09-04 06:49:17 +00:00
** Nuxt.js modules
*/
2019-08-24 03:06:57 +00:00
modules: [
// See https://goo.gl/OOhYW5
['@nuxtjs/pwa', {
manifest: {
name: meta.name,
short_name: meta.name,
description: meta.shortDescription,
display: "standalone",
2019-09-04 02:48:24 +00:00
theme_color: "#282a36",
background_color: "#282a36",
2019-09-04 06:49:17 +00:00
start_url: `${routerBase.router.base}`,
2019-08-24 03:06:57 +00:00
icons: ((sizes) => {
let icons = [];
2019-09-04 06:49:17 +00:00
for (let size of sizes) {
2019-08-24 03:06:57 +00:00
icons.push({
2019-08-24 17:01:57 +00:00
"src": `${routerBase.router.base}icons/icon-${size}x${size}.png`,
2019-08-24 03:06:57 +00:00
"type": "image/png",
"sizes": `${size}x${size}`
});
}
return icons;
})([48, 72, 96, 144, 192, 512])
}
}],
['@nuxtjs/axios']
2019-08-24 03:06:57 +00:00
],
/*
2019-09-04 06:49:17 +00:00
** Build configuration
*/
2019-08-24 03:06:57 +00:00
build: {
/*
2019-09-04 06:49:17 +00:00
** You can extend webpack config here
*/
extend(config, ctx) {}
},
/*
2019-09-04 06:49:17 +00:00
** Generate configuration
*/
generate: {
fallback: true
},
/*
** Router configuration
*/
...routerBase
2019-08-24 03:06:57 +00:00
}