-
Notifications
You must be signed in to change notification settings - Fork 6
/
nuxt.config.ts
119 lines (117 loc) · 2.81 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/// <reference types="nuxt" />
import { resolve } from 'path';
import { isCI, isDevelopment } from 'std-env';
import { splitVendorChunkPlugin } from 'vite';
import TypeDoc from './typedoc/index.mjs';
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
ssr: true,
srcDir: 'src',
modules: [
TypeDoc,
'@nuxt/content',
'@nuxtjs/i18n',
'nuxt-purgecss',
'@vite-pwa/nuxt',
'nuxt-icon',
],
telemetry: false,
css: [
'~/assets/styles/global.css',
resolve(__dirname, 'node_modules/view-ui-plus-es/dist/styles/viewuiplus.css'),
],
vite: {
plugins: [
splitVendorChunkPlugin(),
],
build: {
rollupOptions: {
output: {
manualChunks(id: string) {
if (id.endsWith('.css') || id.includes('&lang.sass') || id.includes('&lang.scss') || id.includes('&lang.css')) {
return 'styles';
}
return 'app';
},
},
},
},
},
content: {
highlight: {
theme: 'one-dark-pro',
},
markdown: {
remarkPlugins: ['remark-heading-id'],
},
},
purgecss: {
enabled: !isDevelopment,
safelist: [
/^(?!ivu-calendar|ivu-avatar|vu-auth|ivu-space|ivu-cascader|ivu-transfer|ivu-arti|ivu-table|ivu-col-|ivu-tabs|ivu-rate|ivu-select-item-selected).*$/,
],
fontFace: true,
keyframes: true,
},
i18n: {
locales: [
{ code: 'en', file: 'en.json' },
{ code: 'uk', file: 'uk.json' },
],
detectBrowserLanguage: {
fallbackLocale: 'en',
},
lazy: true,
defaultLocale: 'en',
langDir: 'locales',
},
app: {
head: {
viewport: 'width=device-width,initial-scale=1',
title: 'Rete.js',
link: [
{ rel: 'icon', href: '/favicon.ico', sizes: 'any' },
{
rel: 'preload', href: '/fonts/Ubuntu-Regular.woff2', as: 'font', type: 'font/woff2', crossorigin: '',
},
{
rel: 'preload', href: '/fonts/Ubuntu-Bold.woff2', as: 'font', type: 'font/woff2', crossorigin: '',
},
],
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
],
},
},
features: {
inlineStyles: false,
},
pwa: {
mode: isCI ? 'production' : 'development',
disable: true,
manifest: {
name: 'Rete.js',
short_name: 'Rete.js',
theme_color: '#ffffff',
icons: [
{
src: '192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: '512x512.png',
sizes: '512x512',
type: 'image/png',
},
],
},
workbox: {
navigateFallback: '/404.html',
globPatterns: ['**/*.{js,css,html,png,svg,ico}'],
},
strategies: 'injectManifest',
srcDir: 'src',
filename: 'sw.ts',
},
});