@globalbrain/sefirot 4.34.0 → 4.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/nuxt.js +9 -1
- package/config/vite.js +43 -4
- package/package.json +1 -1
package/config/nuxt.js
CHANGED
|
@@ -25,7 +25,15 @@ export const baseConfig = {
|
|
|
25
25
|
resolve: { ...baseViteConfig.resolve, alias: {} },
|
|
26
26
|
plugins: baseViteConfig.plugins?.filter(
|
|
27
27
|
(plugin) => plugin && 'name' in plugin && plugin.name !== 'unplugin-icons'
|
|
28
|
-
)
|
|
28
|
+
),
|
|
29
|
+
optimizeDeps: {
|
|
30
|
+
...(baseViteConfig.optimizeDeps || {}),
|
|
31
|
+
exclude: [
|
|
32
|
+
...(baseViteConfig.optimizeDeps?.exclude || []),
|
|
33
|
+
'@vue/devtools-core',
|
|
34
|
+
'@vue/devtools-kit'
|
|
35
|
+
]
|
|
36
|
+
}
|
|
29
37
|
},
|
|
30
38
|
nitro: {
|
|
31
39
|
rollupConfig: {
|
package/config/vite.js
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
+
/// <reference lib="esnext" />
|
|
2
3
|
|
|
4
|
+
import { glob } from 'node:fs/promises'
|
|
5
|
+
import path from 'node:path'
|
|
3
6
|
import { fileURLToPath } from 'node:url'
|
|
4
7
|
import MagicString from 'magic-string'
|
|
5
8
|
import icons from 'unplugin-icons/vite'
|
|
6
|
-
import
|
|
9
|
+
import * as vite from 'vite'
|
|
10
|
+
|
|
11
|
+
const lib = `${path.resolve(import.meta.dirname, '../lib/')}/`
|
|
12
|
+
// eslint-disable-next-line antfu/no-top-level-await
|
|
13
|
+
const files = (await Array.fromAsync(glob(`**/*.ts`, { cwd: lib })))
|
|
14
|
+
.filter((file) => !file.endsWith('.d.ts'))
|
|
15
|
+
.map((file) => `sefirot/${file}`.replace(/(?:\/index)?\.ts$/, ''))
|
|
7
16
|
|
|
8
17
|
/** @type {import('vite').UserConfig} */
|
|
9
18
|
export const baseConfig = {
|
|
@@ -66,10 +75,36 @@ export const baseConfig = {
|
|
|
66
75
|
]
|
|
67
76
|
},
|
|
68
77
|
|
|
69
|
-
ssr: {
|
|
78
|
+
ssr: {
|
|
79
|
+
noExternal: [
|
|
80
|
+
/sentry/
|
|
81
|
+
],
|
|
82
|
+
optimizeDeps: {
|
|
83
|
+
include: [
|
|
84
|
+
'file-saver'
|
|
85
|
+
],
|
|
86
|
+
// @ts-ignore
|
|
87
|
+
// eslint-disable-next-line style/multiline-ternary
|
|
88
|
+
esbuildOptions: vite.rolldownVersion ? undefined : {
|
|
89
|
+
define: {
|
|
90
|
+
'navigator.userAgent': '""'
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
// eslint-disable-next-line style/multiline-ternary
|
|
95
|
+
rolldownOptions: vite.rolldownVersion ? {
|
|
96
|
+
transform: {
|
|
97
|
+
define: {
|
|
98
|
+
'navigator.userAgent': '""'
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
} : undefined
|
|
102
|
+
}
|
|
103
|
+
},
|
|
70
104
|
|
|
71
105
|
optimizeDeps: {
|
|
72
106
|
include: [
|
|
107
|
+
...files,
|
|
73
108
|
'@globalbrain/sefirot/dompurify',
|
|
74
109
|
'dayjs',
|
|
75
110
|
'dayjs/plugin/relativeTime',
|
|
@@ -78,9 +113,13 @@ export const baseConfig = {
|
|
|
78
113
|
'dompurify',
|
|
79
114
|
'file-saver',
|
|
80
115
|
'markdown-it > argparse',
|
|
81
|
-
'markdown-it > entities'
|
|
116
|
+
'markdown-it > entities',
|
|
117
|
+
'qs'
|
|
82
118
|
],
|
|
83
119
|
exclude: [
|
|
120
|
+
'@vueuse/core',
|
|
121
|
+
'fuse.js',
|
|
122
|
+
'lodash-es',
|
|
84
123
|
'markdown-it'
|
|
85
124
|
]
|
|
86
125
|
}
|
|
@@ -91,5 +130,5 @@ export const baseConfig = {
|
|
|
91
130
|
*/
|
|
92
131
|
export function defineConfig(config = {}) {
|
|
93
132
|
return async (/** @type {import("vite").ConfigEnv} */ configEnv) =>
|
|
94
|
-
mergeConfig(baseConfig, await (typeof config === 'function' ? config(configEnv) : config))
|
|
133
|
+
vite.mergeConfig(baseConfig, await (typeof config === 'function' ? config(configEnv) : config))
|
|
95
134
|
}
|