forked from k-urtica/nuxt-news-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.js
141 lines (139 loc) · 3.01 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
require("dotenv").config();
const { BASE_URL, API_KEY } = process.env;
const siteTitle = "NUXT×NEWS APP";
const description =
"今、日本国内・世界で起きている話題のニュースを新聞や通信社など様々なニュースソースから取得して掲載しています。";
const baseUrl = BASE_URL;
const baseDir = "/";
const basePath = baseUrl + baseDir;
export default {
mode: "spa",
head: {
htmlAttrs: {
lang: "ja",
},
titleTemplate: "%s | " + siteTitle,
title: siteTitle,
meta: [
{
charset: "utf-8",
prefix: "og: http://ogp.me/ns#",
},
{
name: "viewport",
content: "width=device-width, initial-scale=1",
},
{
hid: "description",
name: "description",
content: description,
},
// OGP
{
hid: "og:site_name",
property: "og:site_name",
content: siteTitle,
},
{
hid: "og:type",
property: "og:type",
content: "website",
},
{
hid: "og:url",
property: "og:url",
content: basePath,
},
{
hid: "og:title",
property: "og:title",
content: siteTitle,
},
{
hid: "og:description",
property: "og:description",
content: description,
},
{
hid: "og:image",
property: "og:image",
content: baseUrl + "/img/ogp.png",
},
// twitter
{
name: "twitter:card",
content: "summary_large_image",
},
{
name: "twitter:site",
content: "@k_urtica",
},
],
link: [
{
rel: "icon",
type: "image/x-icon",
href: "/favicon.ico",
},
{
rel: "stylesheet",
type: "text/css",
href:
"https://cdn.jsdelivr.net/npm/@mdi/font@4.x/css/materialdesignicons.min.css",
},
],
},
router: {
trailingSlash: true,
middleware: "redirect",
},
loading: {
color: "#81D4FA",
},
css: ["~/assets/css/global.scss"],
plugins: [
"@/plugins/axios",
{ src: "~/plugins/aos", mode: "client" },
"~/plugins/dayjs.js",
],
buildModules: ["@nuxtjs/vuetify", "@nuxtjs/dotenv"],
modules: ["@nuxtjs/axios", "@nuxtjs/pwa"],
axios: {
baseURL: process.env.BASE_URL || "http://localhost:3000",
},
vuetify: {
customVariables: ["~/assets/css/vuetify/variables.scss"],
defaultAssets: {
icons: false,
},
},
serverMiddleware: ["~/api/news.js"],
build: {
extractCSS: true,
},
pwa: {
manifest: {
lang: "ja",
name: "NUXT×NEWS APP",
short_name: "NUXT×NEWS APP",
description,
background_color: "#f0f0f0",
display: "standalone",
},
icon: {
iconSrc: "static/img/icon.png",
},
workbox: {
runtimeCaching: [
{
urlPattern: "^https://fonts.(?:googleapis|gstatic).com/(.*)",
handler: "cacheFirst",
},
],
},
},
env: {
BASE_URL,
API_KEY,
},
};