-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
118 lines (117 loc) · 2.99 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
import { defineNuxtConfig } from 'nuxt'
import config from './config'
import inject from '@rollup/plugin-inject'
import NodeGlobalsPolyfillPlugin from '@esbuild-plugins/node-globals-polyfill'
import nodePolyfills from 'rollup-plugin-node-polyfills'
// import eslintPlugin from "vite-plugin-eslint"
import polyfillExports from './dev/polyfill-exports'
import commonjs from '@rollup/plugin-commonjs';
export default defineNuxtConfig({
meta: {
title: 'ECHO',
meta: [{
name: 'viewport',
content: 'width=device-width, initial-scale=1, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no'
}, {
hid: 'keywords',
name: 'keywords',
content: 'web3, comment widget, tip',
}, {
hid: 'description',
name: 'description',
content: 'ECHO',
}],
script: [
{
src: '/particle.js'
},
/**{
src: 'https://static.particle.network/sdks/web/auth/0.12.2/auth.min.js'
}, {
src: 'https://static.particle.network/sdks/web/provider/0.12.2/provider.min.js'
}, **/
{
src: 'https://analytics.0xecho.com/js/plausible.js',
'data-domain': 'embed.0xecho.com',
defer: true
}],
link: [{
rel: 'icon',
href: '/favicon.ico',
type: 'image/x-icon'
}, {
ref: 'apple-touch-icon',
sizes: '180x180',
href: '/apple-touch-icon.png'
}
// {
// rel: 'preconnect',
// href: 'https://fonts.googleapis.com'
// }, {
// rel: 'preconnect',
// href: 'https://fonts.gstatic.com',
// crossOrigin: ''
// }, {
// rel: 'stylesheet',
// href: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'
// }
]
},
runtimeConfig: {
public: config
},
buildModules: [
'@pinia/nuxt',
],
css: [
'remixicon/fonts/remixicon.css',
'element-plus/dist/index.css',
'@/styles/_element-plus.scss',
'@/styles/_base.scss',
'@/styles/_reset.scss',
'@/styles/_transition.scss',
'@/styles/themes/_default.scss',
'@/styles/themes/_dark.scss',
'@/styles/highlight/github.scss',
'@/styles/highlight/github-dark.scss'
],
vite: {
// plugins: [eslintPlugin()],
plugins: [
//polyfillExports(),
commonjs(),
// inject({ Buffer: ['buffer', 'Buffer'] })
],
optimizeDeps: {
esbuildOptions: {
// Fix global is not defined error
define: {
global: 'globalThis'
},
plugins: [
// Without this, npm run dev will output Buffer or process is not defined error
NodeGlobalsPolyfillPlugin({
buffer: true
})
]
}
},
build: {
rollupOptions: {
// plugins: [nodePolyfills()],
// output: { format: 'cjs' }
},
commonjsOptions: {
transformMixedEsModules: false
}
},
css: {
preprocessorOptions: {
scss: {
additionalData: '@import "@/styles/_var.scss";',
}
}
}
},
ssr: false
})