-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.content.config.js
More file actions
53 lines (51 loc) · 1.44 KB
/
Copy pathvite.content.config.js
File metadata and controls
53 lines (51 loc) · 1.44 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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import { CRX_CONTENT_OUTDIR } from './globalConfig'
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import { resolve, dirname } from 'node:path'
import { fileURLToPath } from 'url'
// https://vitejs.dev/config/
export default defineConfig({
build: {
outDir: CRX_CONTENT_OUTDIR,
lib: {
entry: [
path.resolve(__dirname, 'src/content/index.js'),
],
formats: ['cjs'],
fileName: () => {
return 'content.js'
}
},
rollupOptions: {
output: {
assetFileNames: (assetInfo) => {
return 'content.css'
},
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
define: {
'process.env.NODE_ENV': null
},
plugins: [vue(), Components({
resolvers: [
AntDesignVueResolver({
importStyle: false
})
]
}),
VueI18nPlugin({
/* options */
// locale messages resource pre-compile option
include: resolve(dirname(fileURLToPath(import.meta.url)), './path/to/src/locales/**')
})],
})