mirror of
https://github.com/videojs/video.js.git
synced 2026-11-21 08:24:15 +01:00
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { defineConfig } from 'vite-plus';
|
|
import type { UserConfig as PackUserConfig } from 'vite-plus/pack';
|
|
|
|
import { type PackageBuildMode, packageBuildConfig, packageBuildModes } from '../../build/pack.ts';
|
|
import { cachedTaskInputs, packageTestTask, workspaceTaskDependencies } from '../../build/task.ts';
|
|
|
|
const createPackConfig = (mode: PackageBuildMode): PackUserConfig => ({
|
|
...packageBuildConfig(mode, 'browser'),
|
|
entry: {
|
|
index: './src/index.ts',
|
|
context: './src/context.ts',
|
|
},
|
|
});
|
|
|
|
export default defineConfig({
|
|
run: {
|
|
tasks: {
|
|
build: {
|
|
command: 'vp pack',
|
|
dependsOn: workspaceTaskDependencies(),
|
|
cache: {
|
|
input: cachedTaskInputs,
|
|
output: ['dist/**'],
|
|
},
|
|
},
|
|
'test:ci': packageTestTask(),
|
|
},
|
|
},
|
|
test: {
|
|
// Vitest v4 compatibility: preserve mock call history.
|
|
// Remove after tests no longer rely on calls from setup or earlier tests.
|
|
// https://viteplus.dev/guide/vitest-v5#remove-unneeded-compatibility-settings
|
|
// https://vitest.dev/guide/migration/#clearmocks-is-enabled-by-default
|
|
clearMocks: false,
|
|
environment: 'happy-dom',
|
|
include: ['src/**/*.test.ts'],
|
|
},
|
|
pack: packageBuildModes.map(createPackConfig),
|
|
});
|