forked from share121/inter-knot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
98 lines (96 loc) · 2.11 KB
/
nuxt.config.ts
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
import process from "node:process";
const sw = process.env.SW === "true";
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: "2024-04-03",
devtools: { enabled: true },
devServer: {
port: 5173,
},
nitro: {
compressPublicAssets: true,
},
postcss: {
plugins: {
"postcss-preset-env": {},
},
},
vite: {
esbuild: {
drop: ["debugger", "console"],
},
css: {
preprocessorOptions: {
less: {
additionalData: '@import "~/assets/css/common.less";',
},
},
},
},
app: {
baseURL: "/inter-knot/",
head: {
title: "绳网",
meta: [
{
name: "description",
content: "欢迎来到绳网",
},
{
name: "keywords",
content: "绳网,Inter-Knot,zzz,绝区零,Zenless Zone Zero",
},
],
script: [
{
src: "/inter-knot/plugins/js-sdk-pro.min.js",
id: "LA_COLLECT",
defer: true,
},
],
link: [
{
rel: "icon",
type: "image/svg+xml",
href: "/inter-knot/icon.svg",
},
],
},
},
css: ["~/assets/css/main.less"],
modules: ["@vite-pwa/nuxt", "@vueuse/nuxt"],
pwa: {
strategies: sw ? "injectManifest" : "generateSW",
srcDir: sw ? "service-worker" : undefined,
filename: sw ? "sw.ts" : undefined,
registerType: "autoUpdate",
manifest: {
name: "绳网",
short_name: "绳网",
theme_color: "#121212",
icons: [
{
src: "pwa-999.png",
sizes: "999x999",
type: "image/png",
},
],
},
workbox: {
globPatterns: ["**/*.{js,css,html,png,svg,ico,jpg,jpeg,webp,avif,json}"],
},
injectManifest: {
globPatterns: ["**/*.{js,css,html,png,svg,ico,jpg,jpeg,webp,avif,json}"],
},
client: {
installPrompt: true,
},
devOptions: {
enabled: true,
suppressWarnings: true,
navigateFallback: "/",
navigateFallbackAllowlist: [/^\/$/],
type: "module",
},
},
});