-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
86 lines (84 loc) · 2.98 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
import { defineNuxtConfig } from 'nuxt'
import url from 'url'
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
alias: {
'@assets': url.fileURLToPath(new URL('./frontend/assets', import.meta.url)),
'@styles': url.fileURLToPath(new URL('./frontend/assets/styles', import.meta.url)),
'@public': url.fileURLToPath(new URL('./public', import.meta.url)),
'~@constants': url.fileURLToPath(new URL('./frontend/constants', import.meta.url)),
'~@models': url.fileURLToPath(new URL('./frontend/models', import.meta.url)),
'~@store': url.fileURLToPath(new URL('./frontend/store', import.meta.url)),
'~@utils': url.fileURLToPath(new URL('./frontend/utils', import.meta.url)),
},
app: {
head: {
meta: [
// <meta name="viewport" content="width=device-width, initial-scale=1">
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
],
script: [
// <script src="https://myawesome-lib.js"></script>
// { src: 'https://awesome-lib.js' }
],
link: [
// <link rel="stylesheet" href="https://myawesome-lib.css">
// { rel: 'stylesheet', href: 'https://awesome-lib.css' }
],
// please note that this is an area that is likely to change
style: [
// <style type="text/css">:root { color: red }</style>
// { children: ':root { color: red }', type: 'text/css' }
],
title: 'UDM-ATTRACTION',
htmlAttrs: {
lang: 'ru',
},
}
},
build: {
transpile: ['@vueform/slider', 'swiper'],
},
buildModules: [
'@pinia/nuxt',
'@vuelidate/core',
],
builder: process.env.NODE_ENV === 'production' ? 'vite' : 'vite', //'vite' : 'vite' 'webpack' : 'webpack'
css: [
'modern-normalize/modern-normalize.css', // Файлы из node_modules
'swiper/css/bundle',
'@vuepic/vue-datepicker/dist/main.css',
'@/assets/styles/main.scss', // Файлы из проекта
], // Эти стили будут применены к каждой странице
components: {
dirs: [
'~/components/common',
'~/components/shared',
'~/components/ui'
]
},
experimental: {
reactivityTransform: true,
},
runtimeConfig: {
// The private keys which are only available within server-side
//Доступно только на сервере
apiSecret: 'Im_Avaliable_Only_On_Server',
// Keys within public, will be also exposed to the client-side
//Доступно на сервере и на фронте
public: {
apiBase: 'Im_Avaliable_On_Server_And_Client'
}
},
srcDir: 'frontend/',
serverHandlers: [
{ route: '/api', handler: './backend/index.ts' }, // `/api/**` does NOT handle /api
{ route: '/api/**', handler: './backend/index.ts' },
{ route: '/uploads/**', handler: './backend/index.ts' },
],
telemetry: false,
vite: {
publicDir: url.fileURLToPath(new URL('./public', import.meta.url))
}
})