forked from taokepppooo/soldier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
121 lines (120 loc) · 2.78 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
120
121
import vueJsx from '@vitejs/plugin-vue-jsx'
import { visualizer } from 'rollup-plugin-visualizer'
import IconsResolver from 'unplugin-icons/resolver'
import Components from 'unplugin-vue-components/vite'
import { isDev } from './build/util'
export default defineNuxtConfig({
ssr: true,
experimental: {
reactivityTransform: false,
},
sourcemap: {
server: isDev(),
client: isDev(),
},
modules: [
'@unocss/nuxt',
'@vueuse/nuxt',
'@nuxt/image-edge',
[
'@pinia/nuxt',
{
autoImports: [
// 自动引入 `usePinia()`
'defineStore',
// 自动引入 `usePinia()` 并重命名为 `usePiniaStore()`
['defineStore', 'definePiniaStore'],
],
},
],
'@nuxtjs/critters',
],
app: {
head: {
meta: [
{ charset: 'utf-8' },
{
name: 'viewport',
content: 'width=device-width,initial-scale=1.0',
},
],
},
},
components: {
dirs: [
{
path: '~/components/global',
global: true,
},
{
path: '~/components/layouts',
global: true,
},
{
path: '~/components/pages',
global: true,
},
],
},
css: [
'@unocss/reset/tailwind.css',
'~/assets/less/index.less',
'~/assets/font/iconfont.css',
],
typescript: {
strict: true,
typeCheck: true,
tsConfig: {
vueCompilerOptions: {
jsxTemplates: true,
experimentalRfc436: true,
},
},
},
vite: {
build: {
target: 'esnext',
},
plugins: [
visualizer(),
vueJsx(),
Components({
dts: true,
resolvers: [IconsResolver({})],
}),
],
esbuild: {
pure: ['console.log', 'console.info'],
drop: ['console', 'debugger'],
},
optimizeDeps: {
exclude: ['lodash-es'],
},
},
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
// @ts-ignore nuxt-security is conditional
security: {
headers: {
crossOriginEmbedderPolicy: false,
contentSecurityPolicy: {
value: {
'default-src': ["'self'"],
'base-uri': ["'self'"],
'connect-src': ["'self'", 'https:', 'http:', 'wss:', 'ws:'],
'font-src': ["'self'"],
'form-action': ["'none'"],
'frame-ancestors': ["'none'"],
'img-src': ["'self'", 'https:', 'http:', 'data:'],
'media-src': ["'self'", 'https:', 'http:'],
'object-src': ["'none'"],
'script-src': ["'self'", "'unsafe-inline'", "'wasm-unsafe-eval'"],
'script-src-attr': ["'none'"],
'style-src': ["'self'", "'unsafe-inline'"],
'upgrade-insecure-requests': true,
},
route: '/**',
},
},
rateLimiter: false,
},
})