repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/wasm/__tests__/wasm.spec.ts
playground/wasm/__tests__/wasm.spec.ts
import { expect, test } from 'vitest' import { isBuild, page } from '~utils' test('should work when inlined', async () => { await page.click('.inline-wasm .run') await expect .poll(() => page.textContent('.inline-wasm .result')) .toMatch('42') }) test('should work when output', async () => { await page....
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/module-graph/vite.config.ts
playground/module-graph/vite.config.ts
import { defineConfig } from 'vite' import type { Plugin } from 'vite' export default defineConfig({ plugins: [slowModulePlugin()], }) function slowModulePlugin(): Plugin { return { name: 'slow-module', resolveId(id) { if (id === 'virtual:slow-module') { return '\0virtual:slow-module' ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/module-graph/__tests__/module-graph.spec.ts
playground/module-graph/__tests__/module-graph.spec.ts
import { expect, test } from 'vitest' import { isServe, page, viteServer } from '~utils' test.runIf(isServe)('importedUrls order is preserved', async () => { const el = page.locator('.imported-urls-order') expect(await el.textContent()).toBe('[success]') const mod = await viteServer.environments.client.moduleGra...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/html/__tests__/html.spec.ts
playground/html/__tests__/html.spec.ts
import { beforeAll, describe, expect, test } from 'vitest' import { browserLogs, editFile, getColor, isBuild, isServe, page, serverLogs, untilBrowserLogAfter, viteServer, viteTestUrl, } from '~utils' function fetchHtml(p: string) { return fetch(viteTestUrl + p, { headers: { Accept: 'text/html...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/optimize-missing-deps/__test__/optimize-missing-deps.spec.ts
playground/optimize-missing-deps/__test__/optimize-missing-deps.spec.ts
import { expect, test } from 'vitest' import { port } from './serve' import { isBuild, page } from '~utils' const url = `http://localhost:${port}/` test.runIf(!isBuild)('optimize', async () => { await page.goto(url) // reload page to get optimized missing deps await page.reload() await expect.poll(() => page....
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/optimize-missing-deps/__test__/serve.ts
playground/optimize-missing-deps/__test__/serve.ts
// this is automatically detected by playground/vitestSetup.ts and will replace // the default e2e test serve behavior import path from 'node:path' import { hmrPorts, ports, rootDir } from '~utils' export const port = ports['optimize-missing-deps'] export async function serve(): Promise<{ close(): Promise<void> }> {...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/define/__tests__/define.spec.ts
playground/define/__tests__/define.spec.ts
import { expect, test } from 'vitest' import viteConfig from '../vite.config' import { page } from '~utils' const defines = viteConfig.define const envDefines = viteConfig.environments.client.define test('string', async () => { expect(await page.textContent('.exp')).toBe( String(typeof eval(defines.__EXP__)), ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/ssr-webworker/__tests__/serve.ts
playground/ssr-webworker/__tests__/serve.ts
// this is automatically detected by playground/vitestSetup.ts and will replace // the default e2e test serve behavior import path from 'node:path' import kill from 'kill-port' import { ports, rootDir } from '~utils' export const port = ports['ssr-webworker'] export async function serve(): Promise<{ close(): Promise...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/ssr-webworker/__tests__/ssr-webworker.spec.ts
playground/ssr-webworker/__tests__/ssr-webworker.spec.ts
import { expect, test } from 'vitest' import { port } from './serve' import { findAssetFile, isBuild, page } from '~utils' const url = `http://localhost:${port}` test('/', async () => { await page.goto(url + '/') expect(await page.textContent('h1')).toMatch('hello from webworker') expect(await page.textContent(...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/transform-plugin/__tests__/transform-plugin.spec.ts
playground/transform-plugin/__tests__/transform-plugin.spec.ts
import { expect, test } from 'vitest' import { tests } from './tests' import { page } from '~utils' test('module type should be supported', async () => { expect(await page.textContent('#module-type-json-pre')).toBe('json') expect(await page.textContent('#module-type-json-post')).toBe('js') expect(await page.text...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/transform-plugin/__tests__/tests.ts
playground/transform-plugin/__tests__/tests.ts
import { expect, test } from 'vitest' import { editFile, isBuild, page } from '~utils' export const tests = () => { test('should re-run transform when dependencies are edited', async () => { expect(await page.textContent('#transform-count')).toBe('1') if (isBuild) return editFile('plugin-dep.js', (str) ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/transform-plugin/__tests__/base/transform-plugin.spec.ts
playground/transform-plugin/__tests__/base/transform-plugin.spec.ts
// NOTE: a separate directory from `playground/transform-plugin` is created by playground/vitestGlobalSetup.ts import { tests } from '../tests' tests()
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/fs-serve/root/svgVirtualModulePlugin.ts
playground/fs-serve/root/svgVirtualModulePlugin.ts
import type { Plugin } from 'vite' const svgVirtualModuleId = 'virtual:foo.svg' const resolvedSvgVirtualModuleId = '\0' + svgVirtualModuleId export default function svgVirtualModulePlugin(): Plugin { return { name: 'svg-virtual-module', resolveId(id) { if (id === svgVirtualModuleId) { return re...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/fs-serve/__tests__/fs-serve.spec.ts
playground/fs-serve/__tests__/fs-serve.spec.ts
import net from 'node:net' import path from 'node:path' import { fileURLToPath } from 'node:url' import http from 'node:http' import { afterEach, beforeAll, beforeEach, describe, expect, test, } from 'vitest' import type { Page } from 'playwright-chromium' import WebSocket from 'ws' import testJSON from '.....
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/fs-serve/__tests__/base/fs-serve-base.spec.ts
playground/fs-serve/__tests__/base/fs-serve-base.spec.ts
import { beforeAll, describe, expect, test } from 'vitest' import testJSON from '../../safe.json' import { isServe, page, viteTestUrl } from '~utils' const stringified = JSON.stringify(testJSON) describe.runIf(isServe)('main', () => { beforeAll(async () => { const srcPrefix = viteTestUrl.endsWith('/') ? '' : '/...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/fs-serve/__tests__/deny/fs-serve-deny.spec.ts
playground/fs-serve/__tests__/deny/fs-serve-deny.spec.ts
import { describe, expect, test } from 'vitest' import { isServe, page, viteTestUrl } from '~utils' describe.runIf(isServe)('main', () => { test('**/deny/** should deny src/deny/deny.txt', async () => { const res = await page.request.fetch( new URL('/src/deny/deny.txt', viteTestUrl).href, ) expect(...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/css-no-codesplit/__tests__/css-no-codesplit.spec.ts
playground/css-no-codesplit/__tests__/css-no-codesplit.spec.ts
import { describe, expect, test } from 'vitest' import { getColor, isBuild, listAssets } from '~utils' test('should load all stylesheets', async () => { expect(await getColor('.shared-linked')).toBe('blue') await expect.poll(() => getColor('.async-js')).toBe('blue') }) describe.runIf(isBuild)('build', () => { t...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/assets/static/raw.ts
playground/assets/static/raw.ts
export default function other() { return 1 + 2 }
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/assets/__tests__/assets.spec.ts
playground/assets/__tests__/assets.spec.ts
import path from 'node:path' import { describe, expect, test } from 'vitest' import { browserLogs, editFile, findAssetFile, getBg, getColor, isBuild, isServe, listAssets, notifyRebuildComplete, page, readFile, readManifest, serverLogs, viteTestUrl, watcher, } from '~utils' const assetMatc...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/assets/__tests__/url-base/assets-url-base.spec.ts
playground/assets/__tests__/url-base/assets-url-base.spec.ts
import { beforeAll, describe, expect, test } from 'vitest' import { browserLogs, findAssetFile, getBg, getColor, isBuild, page, } from '~utils' const urlAssetMatch = isBuild ? /http:\/\/localhost:\d+\/other-assets\/asset-[-\w]{8}\.png/ : '/nested/asset.png' const iconMatch = '/icon.png' const absolut...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/assets/__tests__/relative-base/assets-relative-base.spec.ts
playground/assets/__tests__/relative-base/assets-relative-base.spec.ts
import { beforeAll, describe, expect, test } from 'vitest' import { browserLogs, findAssetFile, getBg, getColor, isBuild, page, } from '~utils' const absoluteAssetMatch = isBuild ? /http.*\/other-assets\/asset-[-\w]{8}\.png/ : '/nested/asset.png' // Asset URLs in CSS are relative to the same dir, the ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/assets/__tests__/encoded-base/assets-encoded-base.spec.ts
playground/assets/__tests__/encoded-base/assets-encoded-base.spec.ts
import { beforeAll, describe, expect, test } from 'vitest' import { browserLogs, findAssetFile, getBg, getColor, isBuild, page, } from '~utils' const urlAssetMatch = isBuild ? /\/foo%20bar\/other-assets\/asset-[-\w]{8}\.png/ : '/nested/asset.png' const iconMatch = '/icon.png' const absoluteIconMatch ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/assets/__tests__/runtime-base/assets-runtime-base.spec.ts
playground/assets/__tests__/runtime-base/assets-runtime-base.spec.ts
import { beforeAll, describe, expect, test } from 'vitest' import { browserLogs, findAssetFile, getBg, getColor, isBuild, page, } from '~utils' const absoluteAssetMatch = isBuild ? /\/other-assets\/asset-[-\w]{8}\.png/ : '/nested/asset.png' // Asset URLs in CSS are relative to the same dir, the comput...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/minify/__tests__/minify.spec.ts
playground/minify/__tests__/minify.spec.ts
import fs from 'node:fs' import path from 'node:path' import { expect, test } from 'vitest' import { isBuild, readFile, testDir } from '~utils' test.runIf(isBuild)('no minifySyntax', () => { const assetsDir = path.resolve(testDir, 'dist/assets') const files = fs.readdirSync(assetsDir) const jsFile = files.find(...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/css-codesplit/__tests__/css-codesplit-consistent.spec.ts
playground/css-codesplit/__tests__/css-codesplit-consistent.spec.ts
import { beforeEach, describe, expect, test } from 'vitest' import { findAssetFile, isBuild, startDefaultServe } from '~utils' beforeEach(async () => { await startDefaultServe() }) for (let i = 0; i < 5; i++) { describe.runIf(isBuild)('css-codesplit build', () => { test('should be consistent with same content...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/css-codesplit/__tests__/css-codesplit.spec.ts
playground/css-codesplit/__tests__/css-codesplit.spec.ts
import { describe, expect, test } from 'vitest' import { findAssetFile, getColor, isBuild, listAssets, page, readManifest, } from '~utils' test('should load all stylesheets', async () => { expect(await getColor('h1')).toBe('red') expect(await getColor('h2')).toBe('blue') expect(await getColor('.dynam...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/alias/__tests__/alias.spec.ts
playground/alias/__tests__/alias.spec.ts
import { expect, test } from 'vitest' import { editFile, getColor, isBuild, page } from '~utils' test('fs', async () => { expect(await page.textContent('.fs')).toMatch('[success] alias to fs path') }) test('fs directory', async () => { expect(await page.textContent('.fs-dir')).toMatch( '[success] alias to dir...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/optimize-deps-no-discovery/__tests__/optimize-deps-no-discovery.spec.ts
playground/optimize-deps-no-discovery/__tests__/optimize-deps-no-discovery.spec.ts
import { expect, test } from 'vitest' import { isBuild, page, readDepOptimizationMetadata } from '~utils' test('optimized dep', async () => { expect(await page.textContent('.optimized-dep')).toBe('[success]') }) test('vue + vuex', async () => { expect(await page.textContent('.vue')).toMatch(`[success]`) }) test....
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/preload/vite.config.ts
playground/preload/vite.config.ts
import { defineConfig } from 'vite' export default defineConfig({ build: { outDir: 'dist/normal', minify: 'terser', terserOptions: { format: { beautify: true, }, compress: { passes: 3, }, }, rollupOptions: { output: { // manualChunks(id) { ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/preload/__tests__/preload.spec.ts
playground/preload/__tests__/preload.spec.ts
import { describe, expect, test } from 'vitest' import { browserLogs, isBuild, page } from '~utils' test('should have no 404s', () => { browserLogs.forEach((msg) => { expect(msg).not.toMatch('404') }) }) describe.runIf(isBuild)('build', () => { test('dynamic import', async () => { await page.waitForSele...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/preload/__tests__/resolve-deps/preload-resolve-deps.spec.ts
playground/preload/__tests__/resolve-deps/preload-resolve-deps.spec.ts
import { describe, expect, test } from 'vitest' import { browserLogs, isBuild, page } from '~utils' test('should have no 404s', () => { browserLogs.forEach((msg) => { expect(msg).not.toMatch('404') }) }) describe.runIf(isBuild)('build', () => { test('dynamic import', async () => { await page.waitForSele...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/preload/__tests__/preload-disabled/preload-disabled.spec.ts
playground/preload/__tests__/preload-disabled/preload-disabled.spec.ts
import { describe, expect, test } from 'vitest' import { browserLogs, isBuild, page } from '~utils' test('should have no 404s', () => { browserLogs.forEach((msg) => { expect(msg).not.toMatch('404') }) }) describe.runIf(isBuild)('build', () => { test('dynamic import', async () => { await page.waitForSele...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/resolve/__tests__/resolve.spec.ts
playground/resolve/__tests__/resolve.spec.ts
import fs from 'node:fs' import path from 'node:path' import { fileURLToPath } from 'node:url' import { describe, expect, test } from 'vitest' import { isBuild, isServe, isWindows, page, testDir, viteTestUrl } from '~utils' test('bom import', async () => { expect(await page.textContent('.utf8-bom')).toMatch('[succes...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/resolve/__tests__/mainfields-custom-first/resolve-mainfields-custom-first.spec.ts
playground/resolve/__tests__/mainfields-custom-first/resolve-mainfields-custom-first.spec.ts
import { expect, test } from 'vitest' import { page } from '~utils' test('resolve.mainFields.custom-first', async () => { expect(await page.textContent('.custom-browser-main-field')).toBe( 'resolved custom field', ) })
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/resolve/ts-extension/hello.ts
playground/resolve/ts-extension/hello.ts
export const msg = '[success] use .js extension to import a ts module'
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/resolve/ts-extension/hellotsx.tsx
playground/resolve/ts-extension/hellotsx.tsx
export const msgTsx = '[success] use .js extension to import a tsx module'
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/resolve/ts-extension/hellojsx.tsx
playground/resolve/ts-extension/hellojsx.tsx
export const msgJsx = '[success] use .jsx extension to import a tsx module'
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/resolve/ts-extension/index.ts
playground/resolve/ts-extension/index.ts
import { msg } from './hello.js' import { msgJsx } from './hellojsx.jsx' import { msgTsx } from './hellotsx.js' import { msgCjs } from './hellocjs.cjs' import { msgMjs } from './hellomjs.mjs' export { msg, msgJsx, msgTsx, msgCjs, msgMjs }
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/css-lightningcss/__tests__/css-lightningcss.spec.ts
playground/css-lightningcss/__tests__/css-lightningcss.spec.ts
import { expect, test } from 'vitest' import { editFile, findAssetFile, getBg, getColor, isBuild, page, viteTestUrl, } from '~utils' // note: tests should retrieve the element at the beginning of test and reuse it // in later assertions to ensure CSS HMR doesn't reload the page test('linked css', async (...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/env-nested/__tests__/env-nested.spec.ts
playground/env-nested/__tests__/env-nested.spec.ts
import { expect, test } from 'vitest' import { isBuild, page } from '~utils' const mode = isBuild ? `production` : `development` test('mode', async () => { expect(await page.textContent('.mode')).toBe(mode) }) test('mode file override', async () => { expect(await page.textContent('.mode-file')).toBe(`.env.${mode...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/cli-module/__tests__/cli-module.spec.ts
playground/cli-module/__tests__/cli-module.spec.ts
import { expect, test } from 'vitest' import { port } from './serve' import { page } from '~utils' test('cli should work in "type":"module" package', async () => { // this test uses a custom serve implementation, so regular helpers for browserLogs and goto don't work // do the same thing manually const logs = []...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/cli-module/__tests__/serve.ts
playground/cli-module/__tests__/serve.ts
// this is automatically detected by playground/vitestSetup.ts and will replace // the default e2e test serve behavior import { stripVTControlCharacters } from 'node:util' import { execaCommand } from 'execa' import kill from 'kill-port' import { isBuild, isWindows, killProcess, ports, rootDir, viteBinPath...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/tsconfig-json-load-error/has-error/main.ts
playground/tsconfig-json-load-error/has-error/main.ts
console.log('tsconfig error fixed, file loaded')
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/tsconfig-json-load-error/src/main.ts
playground/tsconfig-json-load-error/src/main.ts
// @ts-nocheck import '../has-error/main'
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/tsconfig-json-load-error/__tests__/tsconfig-json-load-error.spec.ts
playground/tsconfig-json-load-error/__tests__/tsconfig-json-load-error.spec.ts
import { describe, expect, test } from 'vitest' import { clearServeError, serveError } from './serve' import { browserLogs, editFile, isBuild, isServe, page, readFile } from '~utils' const unexpectedTokenSyntaxErrorRE = /(\[vite:esbuild\] )*parsing .* failed: SyntaxError: Unexpected token.*\}.*|Build failed/ descri...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/tsconfig-json-load-error/__tests__/serve.ts
playground/tsconfig-json-load-error/__tests__/serve.ts
import { afterAll } from 'vitest' import { startDefaultServe } from '~utils' export let serveError: Error | undefined export async function serve() { try { await startDefaultServe() } catch (e) { serveError = e } } export function clearServeError() { serveError = undefined } afterAll(() => { if (s...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/tailwind/tailwind.config.ts
playground/tailwind/tailwind.config.ts
import type { Config } from 'tailwindcss' export default { content: [ // Before editing this section, make sure no paths are matching with `/src/main.js` // Look https://github.com/vitejs/vite/pull/6959 for more details __dirname + '/src/{components,views}/**/*.js', __dirname + '/src/main.js', __...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/tailwind/vite.config.ts
playground/tailwind/vite.config.ts
import { defineConfig } from 'vite' import type { Plugin } from 'vite' import tailwindcss from '@tailwindcss/vite' function delayIndexCssPlugin(): Plugin { let server return { name: 'delay-index-css', enforce: 'pre', configureServer(_server) { server = _server }, async load(id) { if...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/tailwind/__test__/tailwind.spec.ts
playground/tailwind/__test__/tailwind.spec.ts
import { expect, test } from 'vitest' import { editFile, getColor, isServe, page, untilBrowserLogAfter } from '~utils' test('should render', async () => { expect(await page.textContent('#pagetitle')).toBe('Page title') }) test.runIf(isServe)( 'full reload happens when the HTML is changed', async () => { awa...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/legacy/__tests__/legacy.spec.ts
playground/legacy/__tests__/legacy.spec.ts
import { describe, expect, test } from 'vitest' import { findAssetFile, getColor, isBuild, listAssets, page, readManifest, } from '~utils' test('should load the worker', async () => { await expect.poll(() => page.textContent('.worker-message')).toMatch('module') }) test('should work', async () => { aw...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/legacy/__tests__/no-polyfills/legacy-no-polyfills.spec.ts
playground/legacy/__tests__/no-polyfills/legacy-no-polyfills.spec.ts
import { expect, test } from 'vitest' import { isBuild, page, viteTestUrl } from '~utils' test('should load and execute the JS file', async () => { await page.goto(viteTestUrl + '/no-polyfills.html') await expect.poll(() => page.textContent('main')).toMatch('👋') }) test.runIf(isBuild)('includes a script tag for ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/legacy/__tests__/ssr/legacy-ssr.spec.ts
playground/legacy/__tests__/ssr/legacy-ssr.spec.ts
import { describe, expect, test } from 'vitest' import { port } from './serve' import { isBuild, page } from '~utils' const url = `http://localhost:${port}` describe.runIf(isBuild)('legacy-ssr', () => { test('should work', async () => { await page.goto(url) expect(await page.textContent('#app')).toMatch('He...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/legacy/__tests__/ssr/serve.ts
playground/legacy/__tests__/ssr/serve.ts
// this is automatically detected by playground/vitestSetup.ts and will replace // the default e2e test serve behavior import path from 'node:path' import { ports, rootDir } from '~utils' export const port = ports['legacy/ssr'] export async function serve(): Promise<{ close(): Promise<void> }> { const { build } = a...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/legacy/__tests__/no-polyfills-no-systemjs/legacy-no-polyfills-no-systemjs.spec.ts
playground/legacy/__tests__/no-polyfills-no-systemjs/legacy-no-polyfills-no-systemjs.spec.ts
import { expect, test } from 'vitest' import { isBuild, page, viteTestUrl } from '~utils' test.runIf(isBuild)('includes only a single script tag', async () => { await page.goto(viteTestUrl + '/no-polyfills-no-systemjs.html') await expect .poll(() => page.getAttribute('#vite-legacy-entry', 'data-src')) .to...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/legacy/__tests__/watch/legacy-styles-only-entry-watch.spec.ts
playground/legacy/__tests__/watch/legacy-styles-only-entry-watch.spec.ts
import { expect, test } from 'vitest' import { editFile, findAssetFile, isBuild, notifyRebuildComplete, readManifest, watcher, } from '~utils' test.runIf(isBuild)('rebuilds styles only entry on change', async () => { expect(findAssetFile(/style-only-entry-.+\.css/, 'watch')).toContain( '#ff69b4', )...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/legacy/__tests__/client-and-ssr/serve.ts
playground/legacy/__tests__/client-and-ssr/serve.ts
// this is automatically detected by playground/vitestSetup.ts and will replace // the default e2e test serve behavior import path from 'node:path' import { ports, rootDir } from '~utils' export const port = ports['legacy/client-and-ssr'] export async function serve(): Promise<{ close(): Promise<void> }> { const { ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/legacy/__tests__/client-and-ssr/legacy-client-legacy-ssr-sequential-builds.spec.ts
playground/legacy/__tests__/client-and-ssr/legacy-client-legacy-ssr-sequential-builds.spec.ts
import { describe, expect, test } from 'vitest' import { port } from './serve' import { isBuild, page } from '~utils' const url = `http://localhost:${port}` describe.runIf(isBuild)('client-legacy-ssr-sequential-builds', () => { test('should work', async () => { await page.goto(url) expect(await page.textCon...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/csp/__tests__/csp.spec.ts
playground/csp/__tests__/csp.spec.ts
import { expect, test } from 'vitest' import { getColor, page } from '~utils' test('linked css', async () => { expect(await getColor('.linked')).toBe('blue') }) test('inline style tag', async () => { expect(await getColor('.inline')).toBe('green') }) test('imported css', async () => { expect(await getColor('.f...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/lib/__tests__/lib.spec.ts
playground/lib/__tests__/lib.spec.ts
import { describe, expect, test } from 'vitest' import { isBuild, isServe, page, readFile, serverLogs } from '~utils' describe.runIf(isBuild)('build', () => { test('es', async () => { expect(await page.textContent('.es')).toBe('It works') }) test('umd', async () => { expect(await page.textContent('.umd'...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/lib/__tests__/serve.ts
playground/lib/__tests__/serve.ts
// this is automatically detected by playground/vitestSetup.ts and will replace // the default e2e test serve behavior import path from 'node:path' import http from 'node:http' import sirv from 'sirv' import { isBuild, page, ports, rootDir, serverLogs, setViteUrl, viteTestUrl, } from '~utils' export con...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/css-lightningcss-proxy/__tests__/css-lightningcss-proxy.spec.ts
playground/css-lightningcss-proxy/__tests__/css-lightningcss-proxy.spec.ts
import { describe, expect, test } from 'vitest' import { port } from './serve' import { getColor, isServe, page } from '~utils' const url = `http://localhost:${port}` describe.runIf(isServe)('injected inline style', () => { test('injected inline style is present', async () => { await page.goto(url) const el...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/css-lightningcss-proxy/__tests__/serve.ts
playground/css-lightningcss-proxy/__tests__/serve.ts
// this is automatically detected by playground/vitestSetup.ts and will replace // the default e2e test serve behavior import path from 'node:path' import kill from 'kill-port' import { hmrPorts, ports, rootDir } from '~utils' export const port = ports['css/lightningcss-proxy'] export async function serve(): Promise...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/dynamic-import-inline/__tests__/dynamic-import-inline.spec.ts
playground/dynamic-import-inline/__tests__/dynamic-import-inline.spec.ts
import { expect, test } from 'vitest' import { isBuild, serverLogs } from '~utils' test.runIf(isBuild)( "don't warn when inlineDynamicImports is set to true", async () => { const log = serverLogs.join('\n') expect(log).not.toContain( 'dynamic import will not move module into another chunk', ) }...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/nested-deps/__tests__/nested-deps.spec.ts
playground/nested-deps/__tests__/nested-deps.spec.ts
import { expect, test } from 'vitest' import { page } from '~utils' test('handle nested package', async () => { expect(await page.textContent('.a')).toBe('A@2.0.0') expect(await page.textContent('.b')).toBe('B@1.0.0') expect(await page.textContent('.nested-a')).toBe('A@1.0.0') const c = await page.textContent(...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/css-dynamic-import/__tests__/css-dynamic-import.spec.ts
playground/css-dynamic-import/__tests__/css-dynamic-import.spec.ts
import type { InlineConfig } from 'vite' import { build, createServer, preview } from 'vite' import { expect, test } from 'vitest' import { getColor, isBuild, isServe, page, ports, rootDir } from '~utils' const baseOptions = [ { base: '', label: 'relative' }, { base: '/', label: 'absolute' }, ] const getConfig = ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/css-dynamic-import/__tests__/serve.ts
playground/css-dynamic-import/__tests__/serve.ts
// this is automatically detected by playground/vitestSetup.ts and will replace // the default e2e test serve behavior // The server is started in the test, so we need to have a custom serve // function or a default server will be created export async function serve() { return { close: () => Promise.resolve(), ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/base-conflict/vite.config.ts
playground/base-conflict/vite.config.ts
import { defineConfig, normalizePath } from 'vite' const rootPath = normalizePath(import.meta.dirname) const absoluteRoot = rootPath.startsWith('/') ? rootPath : `/${rootPath}` const [firstSegment] = absoluteRoot.split('/').filter(Boolean) const base = firstSegment ? `/${firstSegment}/` : '/' const VIRTUAL_MODULE_ID ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/base-conflict/src/virtualModules.d.ts
playground/base-conflict/src/virtualModules.d.ts
declare module 'absolute-importer' { const msg: string export default msg }
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/base-conflict/src/importee.ts
playground/base-conflict/src/importee.ts
export default 'absolute import'
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/base-conflict/src/main.ts
playground/base-conflict/src/main.ts
import message from 'absolute-importer' document.querySelector('.message')!.textContent = message
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/base-conflict/__tests__/base-conflict.spec.ts
playground/base-conflict/__tests__/base-conflict.spec.ts
import { expect, test } from 'vitest' import { page } from '~utils' test('absolute imports keep base prefix', async () => { await expect.poll(() => page.textContent('.message')).toBe('absolute import') })
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/cli/__tests__/cli.spec.ts
playground/cli/__tests__/cli.spec.ts
import { expect, test } from 'vitest' import { port, streams } from './serve' import { editFile, isServe, page } from '~utils' test('cli should work', async () => { // this test uses a custom serve implementation, so regular helpers for browserLogs and goto don't work // do the same thing manually const logs = [...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/cli/__tests__/serve.ts
playground/cli/__tests__/serve.ts
// this is automatically detected by playground/vitestSetup.ts and will replace // the default e2e test serve behavior import { stripVTControlCharacters } from 'node:util' import { execaCommand } from 'execa' import kill from 'kill-port' import { isBuild, isWindows, killProcess, ports, rootDir, viteBinPath...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/proxy-hmr/__tests__/proxy-hmr.spec.ts
playground/proxy-hmr/__tests__/proxy-hmr.spec.ts
import { expect, test } from 'vitest' import { editFile, isBuild, page, untilBrowserLogAfter, viteTestUrl, } from '~utils' test.runIf(!isBuild)('proxy-hmr', async () => { await untilBrowserLogAfter( () => page.goto(viteTestUrl), // wait for both main and sub app HMR connection [/connected/, /co...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/proxy-hmr/__tests__/serve.ts
playground/proxy-hmr/__tests__/serve.ts
// this is automatically detected by playground/vitestSetup.ts and will replace // the default e2e test serve behavior import path from 'node:path' import { rootDir, setViteUrl } from '~utils' export async function serve(): Promise<{ close(): Promise<void> }> { const vite = await import('vite') const rootServer =...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/proxy-bypass/__tests__/proxy-bypass.spec.ts
playground/proxy-bypass/__tests__/proxy-bypass.spec.ts
import { expect, test, vi } from 'vitest' import { browserLogs, page, serverLogs } from '~utils' test('proxy-bypass', async () => { await vi.waitFor(() => { expect(browserLogs.join('\n')).toContain('status of 404 (Not Found)') }) }) test('async-proxy-bypass', async () => { const content = await page.frame('...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/multiple-entrypoints/__tests__/multiple-entrypoints.spec.ts
playground/multiple-entrypoints/__tests__/multiple-entrypoints.spec.ts
import { expect, test } from 'vitest' import { getColor, page } from '~utils' test('should have css applied on second dynamic import', async () => { await expect.poll(() => page.textContent('.content')).toMatch('Initial') await page.click('.b') await expect.poll(() => page.textContent('.content')).toMatch('Refe...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/import-assertion/__tests__/import-assertion.spec.ts
playground/import-assertion/__tests__/import-assertion.spec.ts
import { expect, test } from 'vitest' import { page } from '~utils' test('from source code', async () => { expect(await page.textContent('.src'), 'bar') }) test('from dependency', async () => { expect(await page.textContent('.dep'), 'world') })
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/preserve-symlinks/__tests__/preserve-symlinks.spec.ts
playground/preserve-symlinks/__tests__/preserve-symlinks.spec.ts
import { expect, test } from 'vitest' import { browserLogs, page } from '~utils' test('should have no 404s', () => { browserLogs.forEach((msg) => { expect(msg).not.toMatch('404') }) }) test('not-preserve-symlinks', async () => { expect(await page.textContent('#root')).toBe('hello vite') })
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/dynamic-import/__tests__/dynamic-import.spec.ts
playground/dynamic-import/__tests__/dynamic-import.spec.ts
import { expect, test } from 'vitest' import { browserLogs, findAssetFile, getColor, isBuild, page, serverLogs, } from '~utils' test('should load literal dynamic import', async () => { await page.click('.baz') await expect.poll(() => page.textContent('.view')).toMatch('Baz view') }) test('should load ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/glob-import/vite.config.ts
playground/glob-import/vite.config.ts
import fs from 'node:fs' import path from 'node:path' import { defineConfig } from 'vite' const escapeAliases = fs .readdirSync(path.join(__dirname, 'escape'), { withFileTypes: true }) .filter((f) => f.isDirectory()) .map((f) => f.name) .reduce((aliases: Record<string, string>, dir) => { aliases[`@escape_$...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/glob-import/__tests__/glob-import.spec.ts
playground/glob-import/__tests__/glob-import.spec.ts
import path from 'node:path' import { readdir } from 'node:fs/promises' import { expect, test } from 'vitest' import { addFile, editFile, findAssetFile, isBuild, page, removeFile, } from '~utils' const filteredResult = { './alias.js': { default: 'hi', }, './foo.js': { msg: 'foo', }, "./qu...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/resolve-tsconfig-paths/src/ts.ts
playground/resolve-tsconfig-paths/src/ts.ts
export { default } from '@/imported'
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/resolve-tsconfig-paths/src/nested/b-imported.ts
playground/resolve-tsconfig-paths/src/nested/b-imported.ts
export const value = '[success] b-imported' as const
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/resolve-tsconfig-paths/src/nested/a-imported.ts
playground/resolve-tsconfig-paths/src/nested/a-imported.ts
export const value = '[success] a-imported' as const
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/resolve-tsconfig-paths/src/nested/b.ts
playground/resolve-tsconfig-paths/src/nested/b.ts
export { value } from '@imported'
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/resolve-tsconfig-paths/src/nested/index.ts
playground/resolve-tsconfig-paths/src/nested/index.ts
export { value as valueA } from './a' export { value as valueB } from './b'
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/resolve-tsconfig-paths/src/nested/a.ts
playground/resolve-tsconfig-paths/src/nested/a.ts
export { value } from '@imported'
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/resolve-tsconfig-paths/__tests__/resolve.spec.ts
playground/resolve-tsconfig-paths/__tests__/resolve.spec.ts
import { expect, test } from 'vitest' import { page } from '~utils' test('import from .ts', async () => { await expect.poll(() => page.textContent('.ts')).toMatch('[success]') }) test('import from .js', async () => { await expect.poll(() => page.textContent('.js')).toMatch('[success]') }) test('fallback works', ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/build-old/__tests__/build-old.spec.ts
playground/build-old/__tests__/build-old.spec.ts
import { describe, expect, test } from 'vitest' import { findAssetFile, isBuild, page } from '~utils' describe('syntax preserve', () => { test('import.meta.url', async () => { await expect.poll(() => page.textContent('.import-meta-url')).toBe('string') }) test('dynamic import', async () => { await expect...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/object-hooks/main.ts
playground/object-hooks/main.ts
const app = document.getElementById('transform') app.innerText = '__TRANSFORM__'
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/object-hooks/vite.config.ts
playground/object-hooks/vite.config.ts
/* eslint-disable n/prefer-node-protocol */ import assert from 'assert' import { defineConfig } from 'vite' let count = 0 export default defineConfig({ plugins: [ { name: 'plugin1', buildStart: { async handler() { await new Promise((r) => setTimeout(r, 100)) count += 1 ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/object-hooks/__tests__/object-hooks.spec.ts
playground/object-hooks/__tests__/object-hooks.spec.ts
import { expect, test } from 'vitest' import { page } from '~utils' test('object hooks', async () => { expect(await page.textContent('#transform')).toMatch('ok') })
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/hmr-root/vite.config.ts
playground/hmr-root/vite.config.ts
import path from 'node:path' import url from 'node:url' import { defineConfig } from 'vite' const __dirname = path.dirname(url.fileURLToPath(import.meta.url)) export default defineConfig({ root: path.join(__dirname, './root'), })
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/playground/hmr-root/__tests__/hmr-root.spec.ts
playground/hmr-root/__tests__/hmr-root.spec.ts
import { expect, test } from 'vitest' import { editFile, isServe, page } from '~utils' test.runIf(isServe)('should watch files outside root', async () => { expect(await page.textContent('#foo')).toBe('foo') editFile('foo.js', (code) => code.replace("'foo'", "'foobar'")) await page.waitForEvent('load') await e...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
reduxjs/redux
https://github.com/reduxjs/redux/blob/820301a1865c499ae18ca96ffece122790937b56/tsup.config.ts
tsup.config.ts
import * as babel from '@babel/core' import type { Plugin } from 'esbuild' import { getBuildExtensions } from 'esbuild-extra' import type { Options } from 'tsup' import { defineConfig } from 'tsup' import type { MangleErrorsPluginOptions } from './scripts/mangleErrors.mjs' import { mangleErrorsPlugin } from './scripts/...
typescript
MIT
820301a1865c499ae18ca96ffece122790937b56
2026-01-04T15:28:28.658077Z
false
reduxjs/redux
https://github.com/reduxjs/redux/blob/820301a1865c499ae18ca96ffece122790937b56/src/bindActionCreators.ts
src/bindActionCreators.ts
import type { Dispatch } from './types/store' import type { ActionCreator, ActionCreatorsMapObject, Action } from './types/actions' import { kindOf } from './utils/kindOf' function bindActionCreator<A extends Action>( actionCreator: ActionCreator<A>, dispatch: Dispatch<A> ) { return function (this: any, .....
typescript
MIT
820301a1865c499ae18ca96ffece122790937b56
2026-01-04T15:28:28.658077Z
false
reduxjs/redux
https://github.com/reduxjs/redux/blob/820301a1865c499ae18ca96ffece122790937b56/src/createStore.ts
src/createStore.ts
import $$observable from './utils/symbol-observable' import type { Store, StoreEnhancer, Dispatch, Observer, ListenerCallback, UnknownIfNonSpecific } from './types/store' import type { Action } from './types/actions' import type { Reducer } from './types/reducers' import ActionTypes from './utils/actionTyp...
typescript
MIT
820301a1865c499ae18ca96ffece122790937b56
2026-01-04T15:28:28.658077Z
false
reduxjs/redux
https://github.com/reduxjs/redux/blob/820301a1865c499ae18ca96ffece122790937b56/src/compose.ts
src/compose.ts
type Func<T extends any[], R> = (...a: T) => R /** * Composes single-argument functions from right to left. The rightmost * function can take multiple arguments as it provides the signature for the * resulting composite function. * * @param funcs The functions to compose. * @returns A function obtained by compos...
typescript
MIT
820301a1865c499ae18ca96ffece122790937b56
2026-01-04T15:28:28.658077Z
false
reduxjs/redux
https://github.com/reduxjs/redux/blob/820301a1865c499ae18ca96ffece122790937b56/src/index.ts
src/index.ts
// functions import { createStore, legacy_createStore } from './createStore' import combineReducers from './combineReducers' import bindActionCreators from './bindActionCreators' import applyMiddleware from './applyMiddleware' import compose from './compose' import isAction from './utils/isAction' import isPlainObject ...
typescript
MIT
820301a1865c499ae18ca96ffece122790937b56
2026-01-04T15:28:28.658077Z
false