-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
86 lines (75 loc) · 1.58 KB
/
Copy pathnuxt.config.ts
File metadata and controls
86 lines (75 loc) · 1.58 KB
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 path from 'node:path'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
const lifecycle = process.env.npm_lifecycle_event
// https://nuxt.com/docs/api/nuxt-config
export default defineNuxtConfig({
app: {
head: {
script: [
{
type: 'text/javascript',
src: 'https://map.qq.com/api/js?v=2.exp&key=RGWBZ-4LICB-C3VU3-NH2T5-PWBHJ-W7FWQ',
},
],
},
},
modules: [
'@nuxtjs/tailwindcss',
'@element-plus/nuxt',
'@nuxt/eslint',
'@pinia/nuxt',
],
build: {
transpile: lifecycle === 'build' ? ['element-plus'] : [],
},
hooks: {
'pages:extend': function (routes) {
routes.push({
path: '/home',
name: 'home',
file: '~/pages/index.vue',
})
},
},
css: [
'~/assets/scss/element.scss',
'~/assets/scss/banner.scss',
'~/assets/scss/base.scss',
'~/assets/scss/function.scss',
],
components: true,
vite: {
plugins: [
createSvgIconsPlugin({
iconDirs: [path.resolve(process.cwd(), 'assets/svg')],
}),
],
build: {
chunkSizeWarningLimit: 4096,
rollupOptions: {
output: {},
},
},
css: {
preprocessorOptions: {
scss: {
additionalData: '@import "~/assets/scss/variables.scss";',
},
},
},
},
eslint: {
config: {
standalone: false,
},
},
future: {
compatibilityVersion: 4,
},
runtimeConfig: {
public: {
baseUrl: process.env.NUXT_PUBLIC_BASE_URL,
serviceUrl: process.env.NUXT_PUBLIC_SERVICE_URL,
},
},
})