Skip to content

Commit

Permalink
Update vite confings for isolated declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
enjikaka committed Aug 26, 2024
1 parent 1c83b83 commit a773368
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 123 deletions.
10 changes: 8 additions & 2 deletions packages/auth/vite-legacy.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import topLevelAwait from 'vite-plugin-top-level-await';
import { defineConfig, mergeConfig } from 'vitest/config';
import {
type UserConfigFnObject,
defineConfig,
mergeConfig,
} from 'vitest/config';

import defaultViteConfig from './vite.config';

export default defineConfig(configEnv =>
const config: UserConfigFnObject = defineConfig(configEnv =>
mergeConfig(
defaultViteConfig(configEnv),
defineConfig({
Expand All @@ -20,3 +24,5 @@ export default defineConfig(configEnv =>
}),
),
);

export default config;
10 changes: 8 additions & 2 deletions packages/auth/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import dts from 'vite-plugin-dts';
import { type UserConfig, defineConfig } from 'vitest/config';
import {
type UserConfig,
type UserConfigFnObject,
defineConfig,
} from 'vitest/config';

export default defineConfig(({ command }) => {
const config: UserConfigFnObject = defineConfig(({ command }) => {
// needed for demo cors
const serverExtras: UserConfig =
command === 'serve'
Expand Down Expand Up @@ -49,3 +53,5 @@ export default defineConfig(({ command }) => {
...serverExtras,
};
});

export default config;
6 changes: 4 additions & 2 deletions packages/common/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dts from 'vite-plugin-dts';
import { configDefaults, defineConfig } from 'vitest/config';
import { configDefaults, defineConfig, type UserConfig } from 'vitest/config';

export default defineConfig({
const config: UserConfig = defineConfig({
build: {
lib: {
entry: 'src/index.ts',
Expand All @@ -28,3 +28,5 @@ export default defineConfig({
unstubGlobals: true,
},
});

export default config;
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export function getDemoPlaybackInfo(options: Options): PlaybackInfo {
};
}

export async function fetchPlaybackInfo(options: Options) {
export async function fetchPlaybackInfo(options: Options): Promise<PlaybackInfo> {
const { streamingSessionId } = options;
const events = [];

Expand Down
6 changes: 4 additions & 2 deletions packages/player/vite-legacy.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import topLevelAwait from 'vite-plugin-top-level-await';
import { defineConfig, mergeConfig } from 'vitest/config';
import { defineConfig, mergeConfig, type UserConfig } from 'vitest/config';

import defaultViteConfig from './vite.config';

export default mergeConfig(
const config: UserConfig = mergeConfig(
defaultViteConfig,
defineConfig({
build: {
Expand All @@ -18,3 +18,5 @@ export default mergeConfig(
plugins: [topLevelAwait()],
}),
);

export default config;
6 changes: 4 additions & 2 deletions packages/player/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dts from 'vite-plugin-dts';
import { defineConfig } from 'vitest/config';
import { defineConfig, type UserConfig } from 'vitest/config';

export default defineConfig({
const config: UserConfig = defineConfig({
build: {
lib: {
entry: 'src/index.ts',
Expand All @@ -23,3 +23,5 @@ export default defineConfig({
unstubGlobals: true,
},
});

export default config;
6 changes: 4 additions & 2 deletions packages/true-time/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dts from 'vite-plugin-dts';
import { defineConfig } from 'vitest/config';
import { defineConfig, type UserConfig } from 'vitest/config';

export default defineConfig({
const config: UserConfig = defineConfig({
build: {
lib: {
entry: 'src/index.ts',
Expand All @@ -26,3 +26,5 @@ export default defineConfig({
unstubGlobals: true,
},
});

export default config;
Loading

0 comments on commit a773368

Please sign in to comment.