GitShow/vitejs/vite
vitejs

vite

Next generation frontend tooling. It's fast!

by vitejs
build-tooldev-serverfrontendhmrvite
Star on GitHubForkWebsitenpm

TypeScript

81.6k stars8.4k forks1.3k contributorsActive · 1h agoSince 2020v8.1.2MIT

Meet the team

See all 1308 on GitHub →
yyx990803
yyx9908031.9k contributions
sapphi-red
sapphi-red1.8k contributions
patak-cat
patak-cat1.0k contributions
bluwy
bluwy589 contributions
renovate[bot]Bot
renovate[bot]441 contributions
antfu
antfu207 contributions
btea
btea150 contributions
hi-ogawa
hi-ogawa112 contributions

Languages

View on GitHub →
TypeScript82.6%
JavaScript9.5%
HTML4.6%
CSS2.7%
Vue0.2%
Svelte0.2%
Other0.2%

Commit activity

Last 12 weeks · 258 commits

Full graph →

Community health

5 of 6 standards met

Community profile →
87
✓README✓License✓Contributing✓Code of Conduct○Issue Template✓PR Template

Recent PRs & issues

Active · Last activity 1h ago
See all on GitHub →
dogledogle
docs(guide): fix grammarOpenPR

dogledogle · 12m ago
sapphi-red
fix: resolve root to real pathOpenPR

https://github.com/vitejs/vite/pull/22685#issuecomment-4849906715

sapphi-red · 1h ago
nickgros
Issue with tree-shaking in Vite 8.1.0 / rolldown >= 1.1.0 with complex module graphOpenIssue

Describe the bug A Vite 8.1.x production build produces a bundle that throws at runtime: Dev mode works correctly. In the bundle, the bug is caused by a reference to an undeclared variable: The imported module code comes from a dependency, . The variable Context is never declared or imported in the generated bundle at this location, though a correctly-bound version of the same value exists elsewhere in the same bundle under a renamed identifier (IconContext$2): I attempted to do some bisection to narrow down the issue. The bug goes away if I set my dependency overrides to . The bug still occurs with rolldown 1.1.0-1.1.3. The bug also goes away (without overrides) if I patch package.json to (from ). Kind of tangential, but we recently migrated our repository to pnpm, so I also verified that the bug occurs when using either npm or pnpm with Vite 8.1.0, so it does not seem to be a npm vs. pnpm dependency resolution issue. Apologies, but I unfortunately could not figure out how to reproduce this in the Rolldown REPL or in a Vite StackBlitz after about an hour or so of trying. Reproduction https://github.com/rjsf-team/react-jsonschema-form/commit/183844e3b98986a0dd125e7216540fd47971deaa Steps to reproduce Checkout the react-jsonschema-form repository in commit 183844e3b98986a0dd125e7216540fd47971deaa. System Info Used Package Manager pnpm Logs Click to expand! ``Unable to preload CSS for ${dep}`)));\n' + '\t\t\t});\n' + '\t\t}));\n' + '\t}\n' + '\tfunction handlePreloadError(err) {\n' + '\t\tconst e = new Event("vite:preloadError", { cancelable: true });\n' + '\t\te.payload = err;\n' + '\t\twindow.dispatchEvent(e);\n' + '\t\tif (!e.defaultPrevented) throw err;\n' + '\t}\n' + '\treturn promise.then((res) => {\n' + '\t\tfor (const item of res []) {\n' + '\t\t\tif (item.status !== "rejected") continue;\n' + '\t\t\thandlePreloadError(item.reason);\n' + '\t\t}\n' + '\t\treturn baseModule().catch(handlePreloadError);\n' + '\t});\n' + '}', insertPreload: true, optimizeModulePreloadRelativePaths: false, renderBuiltUrl: false, isRelativeBase: true }, enforce: undefined }, { name: 'vite:terser', applyToEnvironment: [Function: applyToEnvironment], renderChunk: [AsyncFunction: renderChunk], closeBundle: [Function: closeBundle] }, { name: 'vite:license', generateBundle: [Function: generateBundle] }, BuiltinPlugin { name: 'builtin:vite-reporter', _options: { root: '/Users/nickgros/dev/react-jsonschema-form/packages/playground', isTty: false, isLib: false, assetsDir: 'assets/', chunkLimit: 500, logInfo: [Function (anonymous)], reportCompressedSize: true, warnLargeChunks: true }, enforce: undefined }, BuiltinPlugin { name: 'builtin:vite-load-fallback', _options: undefined, enforce: undefined } ], optimizeDepsPluginNames: [] } }, configFile: '/Users/nickgros/dev/react-jsonschema-form/packages/playground/vite.config.ts', configFileDependencies: [ '/Users/nickgros/dev/react-jsonschema-form/packages/playground/vite.config.ts' ], inlineConfig: { root: undefined, base: undefined, mode: undefined, configFile: undefined, configLoader: undefined, logLevel: undefined, clearScreen: undefined, build: { rolldownOptions: undefined, rollupOptions: [Getter/Setter] }, worker: { rolldownOptions: undefined, rollupOptions: [Getter/Setter] }, optimizeDeps: { rolldownOptions: undefined, rollupOptions: [Getter/Setter] } }, root: '/Users/nickgros/dev/react-jsonschema-form/packages/playground', decodedBase: './', rawBase: './', publicDir: '/Users/nickgros/dev/react-jsonschema-form/packages/playground/public', cacheDir: '/Users/nickgros/dev/react-jsonschema-form/packages/playground/node_modules/.vite', command: 'build', mode: 'production', isWorker: false, mainConfig: null, bundleChain: [], isProduction: true, css: { transformer: 'postcss', preprocessorMaxWorkers: true, devSourcemap: false }, json: { namedExports: true, stringify: 'auto' }, esbuild: { jsxDev: false, charset: 'utf8', legalComments: 'none' }, builder: undefined, preview: { port: 4173, strictPort: false, host: undefined, allowedHosts: [], https: undefined, open: false, proxy: undefined, cors: { origin: /^https?:\/\/(?:(?:[^:]+\.)?localhost\[::1\])(?::\d+)?$/ }, headers: {} }, envDir: '/Users/nickgros/dev/react-jsonschema-form/packages/playground', env: { BASE_URL: './', MODE: 'production', DEV: false, PROD: true }, assetsInclude: [Function: assetsInclude], rawAssetsInclude: [], logger: { hasWarned: false, info: [Function: info], warn: [Function: warn], warnOnce: [Function: warnOnce], error: [Function: error], clearScreen: [Function: clearScreen], hasErrorLogged: [Function: hasErrorLogged] }, packageCache: Map(1) { 'fnpd_/Users/nickgros/dev/react-jsonschema-form/packages/playground' => { dir: '/Users/nickgros/dev/react-jsonschema-form/packages/playground', data: { name: '@rjsf/playground', version: '6.6.2', description: 'rjsf playground', private: true, type: 'commonjs', scripts: { 'cs-check': 'oxfmt --check "src/*/.{ts,tsx}"', 'cs-format': 'oxfmt "src/*/.{ts,tsx}"', build: 'rimraf build && cross-env NODE_ENV=production vite build', lint: 'oxlint src', precommit: 'lint-staged', 'publish-to-gh-pages': 'pnpm run build && gh-pages --dist build/', 'publish-to-npm': 'pnpm run build && pnpm publish', start: 'vite --force', preview: 'vite preview', test: 'vitest run' }, 'lint-staged': { 'src/*/.{ts,tsx}': [ 'oxlint --fix', 'oxfmt' ] }, files: [ 'dist', 'lib', 'src' ], engineStrict: false, engines: { node: '>=20' }, dependencies: { '@ant-design/icons': '^6.2.5', '@ant-design/cssinjs': '^2.1.2', '@babel/runtime': '^7.29.7', '@chakra-ui/react': '^3.35.0', '@emotion/react': '^11.14.0', '@mantine/core': '^8.3.18', '@mantine/dates': '^8.3.18', '@mantine/hooks': '^8.3.18', '@mui/material': '^9.1.2', '@rjsf/antd': 'workspace:^', '@rjsf/chakra-ui': 'workspace:^', '@rjsf/core': 'workspace:^', '@rjsf/daisyui': 'workspace:^', '@rjsf/fluentui-rc': 'workspace:^', '@rjsf/mantine': 'workspace:^', '@rjsf/mui': 'workspace:^', '@rjsf/primereact': 'workspace:^', '@rjsf/react-bootstrap': 'workspace:^', '@rjsf/semantic-ui': 'workspace:^', '@rjsf/shadcn': 'workspace:^', '@rjsf/utils': 'workspace:^', '@rjsf/validator-ajv8': 'workspace:^', '@rjsf/validator-ata': 'workspace:^', ajv: '^8.20.0', 'ajv-i18n': '^4.2.0', antd: '^6.4.3', atob: '^2.1.2', 'chakra-react-select': '^6.1.3', 'core-js': '^3.49.0', dayjs: '^1.11.21', 'deep-freeze-es6': '^5.0.0', 'fast-deep-equal': '^3.1.3', 'fast-uri': '^3.0.1', jss: '^10.10.0', 'json-schema-traverse': '^1.0.0', lodash: '^4.18.1', 'lucide-react': '^1.16.0', 'monaco-editor': '^0.55.1', primereact: '^10.9.8', react: '^18.3.1', 'react-bootstrap': '^2.10.10', 'react-dom': '^18.3.1', 'react-frame-component': '^5.3.2', 'react-is': '^18.3.1', 'react-resizable-panels': '^4.11.2', 'require-from-string': '^2.0.2', scheduler: '^0.23.2', 'semantic-ui-react': '^2.1.5' }, devDependencies: { '@emotion/cache': '^11.14.0', '@emotion/react': '^11.14.0', '@emotion/styled': '^11.14.1', '@monaco-editor/react': '^4.7.0', '@mui/icons-material': '^9.1.1', '@types/react-frame-component': '^4.1.6', '@vitejs/plugin-react': '^6.0.2', 'gh-pages': '^6.3.0', html: '^1.0.0', 'html-webpack-plugin': '^5.6.7', 'loader-utils': '^3.3.1', 'mini-css-extract-plugin': '^2.10.2', 'react-transform-catch-errors': '^1.0.2', 'react-transform-hmr': '^1.0.4', 'source-map-loader': '^5.0.0', vite: '8.1.0' }, directories: { test: 'test' }, repository: { type: 'git', url: 'git+https://github.com/rjsf-team/react-jsonschema-form.git' }, author: 'Nicolas Perriault ', contributors: [ 'Heath Chiavettone Validations [x] Follow our Code of Conduct [x] Read the Contributing Guidelines. [x] Read the docs. [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. [x] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead. [x] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server. [x] The provided reproduction is a minimal reproducible example of the bug.

nickgros · 1h ago

Recent fixes

View closed PRs →
shulaoda
fix: preload css for nested dynamic importsMergedPR

Description Fixes #22700 and closes #22721 In a nested dynamic import like where has a CSS dependency, the production build set the outer import's preload deps to . The stylesheet for was emitted to disk and listed in the table, but nothing referenced its index, so no `generateBundleimportAnalysisBuild.tsimport()__VITE_PRELOAD__import().then()void 0import().then()__vitePreload(() => import('a'), Ma).then(() => __vitePreload(() => import('b'), Mb))import a m.prop).then(() => import())cond ? import(a) : import(b).thenplayground/dynamic-import/nested/then-css/import().then(() => import())mainpnpm --filter vite buildpnpm test-build dynamic-import` both pass, serve mode passes, and eslint and oxfmt are clean. Thanks to @mturac for digging into this in #22721. Co-authored-by: mehmet turac

shulaoda · 1h ago
mturac
fix: preload css for nested dynamic imports (fix #22700)MergedPR

Description Fixes #22700. Nested dynamic imports could reuse a preload marker that had already been paired with an earlier import. When that happened, the outer import could lose its dependency list and the CSS for the imported chunk would not be loaded in production builds. This change skips already-consumed preload markers before rewriting the marker for the current dynamic import. The regression test exercises the build-only behavior in the dynamic-import playground by checking that the nested import creates a stylesheet link and applies the imported CSS. Tests

mturac · 1h ago
charlsantony
Build: nested `import().then(() => import())` drops outer `__vitePreload` deps to `void 0`, orphaning CSSClosedIssue

Describe the bug With a nested dynamic import of the form where has any CSS side-effect dep, the outer dynamic import in the built entry chunk is wrapped as instead of . The inner import's deps array is correct. The CSS file is emitted to disk and even appears in the lookup table, but nothing references its index — no preload call, no `viteimport('./a.js')__vitePreload(() => import('./a-…js'), __vite__mapDeps([…, 'a-….css']))__vite__mapDepsa-….jsa-….csspackages/vite/src/node/plugins/importAnalysisBuild.tsgenerateBundleimport()__VITE_PRELOAD__end.then(...)[a, b]./aend_a./arewroteMarkerStartPos./bend_b./brewroteMarkerStartPos"void 0"./a./amain.jsnpm installnpm run builddist/assets/index-.js__vitePreloadvoid 0grep -rn "a-.\.css" dist/__vite__mapDepsindex.htmlnpm run previewvite` (dev mode) is unaffected. System Info Used Package Manager pnpm Logs _No response_ Validations [x] Follow our Code of Conduct [x] Read the Contributing Guidelines. [x] Read the docs. [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. [x] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead. [x] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server. [x] The provided reproduction is a minimal reproducible example of the bug.

charlsantony · 1h ago
Structured data for AI agents

Repository: vitejs/vite. Description: Next generation frontend tooling. It's fast! Stars: 81640, Forks: 8366. Primary language: TypeScript. Languages: TypeScript (82.6%), JavaScript (9.5%), HTML (4.6%), CSS (2.7%), Vue (0.2%). License: MIT. Homepage: http://vite.dev Topics: build-tool, dev-server, frontend, hmr, vite. Latest release: v8.1.2 (12h ago). Open PRs: 100, open issues: 624. Last activity: 1h ago. Community health: 87%. Top contributors: yyx990803, sapphi-red, patak-cat, bluwy, renovate[bot], antfu, btea, hi-ogawa, underfin, shulaoda and others.

·@ofershap

Replace github.com with gitshow.dev