-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvite.config.ts
33 lines (32 loc) · 957 Bytes
/
vite.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
import { defineConfig, mergeConfig } from 'vite'
import baseConfig from '../browser-extension-template/vite.config'
import { viteStaticCopy } from 'vite-plugin-static-copy'
export default defineConfig(
mergeConfig(
baseConfig,
{
root: '../browser-extension-template',
plugins: [
viteStaticCopy({
targets: [
{
// TODO: try to refactor this copying to normal building
src: '../../packages/visual-engine/dist/readapt-visual-engine.browser.js',
dest: 'scripts'
},
{
src: '../chrome-extension/manifest.json',
dest: '.',
transform(content) {
const manifest = JSON.parse(content)
manifest.version = process.env.npm_package_version
return JSON.stringify(manifest, null, 2)
}
}
]
})
]
},
true
)
)