-
Notifications
You must be signed in to change notification settings - Fork 7
/
nuxt.config.js
152 lines (147 loc) · 3.5 KB
/
nuxt.config.js
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
import abcConfig from './abc.config'
export default {
ssr: false,
target: 'server',
srcDir: 'src',
server: {
host: '0.0.0.0',
port: abcConfig.port,
},
/*
** Headers of the page
*/
head: {
// titleTemplate: '%s - ' + 'bit.cc',
title: '.bit Account',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width,height=device-height,initial-scale=1.0,maximum-scale=1.0,user-scalable=no' },
],
script: [{
src: 'https://lf1-cdn-tos.bytegoofy.com/obj/iconpark/svg_15572_12.27ec46fc62a5e02b6174eb8451b00c8f.js',
async: true,
}]
},
/*
** Customize the progress-bar color
*/
loading: { color: '#fff' },
/*
** Global CSS
*/
css: [
'~/assets/index.scss'
],
/*
** Plugins to load before mounting the App
*/
plugins: [
'~/plugins/resolve',
'~/plugins/i18n',
'~/plugins/service',
],
// serverMiddleware: [
// '~/serverMiddleware/api_mibao.ts'
// ],
router: {
middleware: [],
extendRoutes (routes, resolve) {
routes.push({
name: 'ACCOUNT_BIT',
path: '*.bit',
component: resolve(__dirname, 'src/pages/index.vue')
})
}
},
/*
** Nuxt.js dev-modules
*/
buildModules: [
['@nuxt/typescript-build', {
typeCheck: false,
}],
// https://composition-api.nuxtjs.org
'@nuxtjs/composition-api/module',
/*
** vuetify module configuration
** https://github.com/nuxt-community/vuetify-module
*/
// ['@nuxtjs/vuetify', {
// customVariables: ['~/assets/variables.scss'],
// }]
],
/*
** Nuxt.js modules
*/
modules: [
// https://i18n.nuxtjs.org/
// [
// 'nuxt-i18n',
// {
// locales: [
// { code: 'en', iso: 'en-US', file: 'en.json' },
// { code: 'zh', iso: 'zh-CN', file: 'zh-CN.json' },
// ],
// }
// ],
['@nuxtjs/google-gtag', {
id: 'G-Z8V922MV9H',
debug: abcConfig.isDev,
}],
[
'@nuxtjs/sentry',
{
dsn: 'https://[email protected]/14',
disabled: abcConfig.isDev,
config: {
autoSessionTracking: false,
}
}
]
],
render: {
// prevent preload, improve first time performance
resourceHints: false
},
/*
** Build configuration
*/
build: {
extractCSS: true,
babel: {
presets ({ isServer }, [preset, options]) {
let targets
// Keep default target in server side
if (isServer) {
targets = { node: 'current' }
}
// Custom target in client side
else {
// Compile to ES5 for better compatibility in production
if (!abcConfig.isDev) {
targets = { ie: 11 }
}
// Compile to ESNext for easier debugging in development
else {
targets = { chrome: 100 }
}
}
options.targets = targets
}
},
/*
** You can extend webpack config here
*/
extend (config, ctx) {
// Disable webpack devtool for better typescript debug experience
config.devtool = false
// allow importing .mjs, fixing the problem importing @vueuse/core (the code below can be delete after [email protected])
// https://github.com/nuxt/nuxt.js/pull/9180/files#diff-4b8d1a6115f7d4a733f4132901f1dfc80c69504b68679ecf21e657bb5e9d9491R333
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto'
})
}
}
}