mirror of
https://github.com/langgenius/dify.git
synced 2026-05-27 04:16:16 +08:00
Co-authored-by: GareArc <garethcxy@dify.ai> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: L1nSn0w <l1nsn0w@qq.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: gigglewang <gigglewang@dify.ai> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Xiyuan Chen <52963600+GareArc@users.noreply.github.com>
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import { defineConfig } from 'vite-plus'
|
|
import { resolveBuildInfo } from './scripts/lib/resolve-buildinfo.js'
|
|
|
|
const buildInfo = resolveBuildInfo()
|
|
|
|
export default defineConfig({
|
|
pack: {
|
|
entry: ['src/index.ts', 'src/commands/**/*.ts', 'src/framework/**/*.ts'],
|
|
format: ['esm'],
|
|
fixedExtension: false,
|
|
dts: true,
|
|
clean: true,
|
|
sourcemap: true,
|
|
treeshake: false,
|
|
outDir: 'dist',
|
|
target: 'node22',
|
|
define: {
|
|
__DIFYCTL_VERSION__: JSON.stringify(buildInfo.version),
|
|
__DIFYCTL_COMMIT__: JSON.stringify(buildInfo.commit),
|
|
__DIFYCTL_BUILD_DATE__: JSON.stringify(buildInfo.buildDate),
|
|
__DIFYCTL_CHANNEL__: JSON.stringify(buildInfo.channel),
|
|
__DIFYCTL_MIN_DIFY__: JSON.stringify(buildInfo.minDify),
|
|
__DIFYCTL_MAX_DIFY__: JSON.stringify(buildInfo.maxDify),
|
|
},
|
|
},
|
|
test: {
|
|
environment: 'node',
|
|
setupFiles: ['./test/setup.ts'],
|
|
include: ['test/**/*.test.ts', 'src/**/*.test.ts', 'scripts/**/*.test.ts'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'text-summary', 'json'],
|
|
include: ['src/**/*.ts'],
|
|
exclude: ['src/**/*.test.ts', 'src/types/**'],
|
|
},
|
|
},
|
|
})
|