├── playground ├── css │ ├── weapp.wxss │ ├── pkg-dep │ │ ├── index.js │ │ ├── _index.scss │ │ └── package.json │ ├── glob-dep.css │ ├── postcss-source-input.css │ ├── async.css │ ├── async │ │ ├── base.css │ │ ├── async-1.css │ │ ├── async-2.css │ │ ├── async-3.module.css │ │ ├── index.js │ │ ├── async-1.js │ │ ├── async-2.js │ │ └── async-3.js │ ├── aliased │ │ ├── foo.css │ │ └── bar.module.css │ ├── css-dep │ │ ├── index.styl │ │ ├── index.css │ │ ├── index.js │ │ ├── index.scss │ │ └── package.json │ ├── glob-dep │ │ ├── bar.css │ │ ├── foo.css │ │ └── nested (dir) │ │ │ └── baz.css │ ├── css-js-dep │ │ ├── foo.css │ │ ├── bar.module.css │ │ ├── index.js │ │ └── package.json │ ├── glob-import │ │ ├── foo.css │ │ └── bar.css │ ├── mod.module.css │ ├── raw-imported.css │ ├── same-name │ │ ├── sub1 │ │ │ ├── sub.css │ │ │ └── sub.js │ │ └── sub2 │ │ │ ├── sub.css │ │ │ └── sub.js │ ├── composed.module.css │ ├── composed.module.less │ ├── linked-at-import.css │ ├── mod.module.scss │ ├── nested │ │ ├── _partial.scss │ │ ├── css-in-less.css │ │ ├── css-in-scss.css │ │ ├── css-in-less-2.less │ │ ├── icon.png │ │ ├── css-in-less.less │ │ ├── nested.styl │ │ └── nested.sss │ ├── unsupported.css │ ├── async-treeshaken.css │ ├── composed.module.scss │ ├── css-dep-exports │ │ ├── index.js │ │ ├── style.css │ │ └── style.scss │ ├── css-proxy-dep │ │ ├── index.css │ │ └── package.json │ ├── inline.module.css │ ├── minify.css │ ├── charset.css │ ├── css-proxy-dep-nested │ │ ├── index.css │ │ └── package.json │ ├── imported-at-import.css │ ├── ok.png │ ├── jsfile.css.js │ ├── postcss-caching │ │ ├── blue-app │ │ │ ├── imported.css │ │ │ └── main.js │ │ └── green-app │ │ │ ├── imported.css │ │ │ └── main.js │ ├── sugarss.sss │ ├── imported.scss │ ├── inlined.css │ ├── layered │ │ ├── blue.css │ │ ├── green.css │ │ └── index.css │ ├── folder with space │ │ ├── ok.png │ │ └── space.css │ ├── __tests__ │ │ ├── no-css-minify │ │ │ └── vite.config.js │ │ └── same-file-name │ │ │ └── vite.config.js │ ├── options │ │ ├── absolute-import.styl │ │ └── relative-import.styl │ ├── dep.css │ ├── linked.css │ ├── less │ │ ├── components │ │ │ └── form.less │ │ └── images │ │ │ └── backgrounds │ │ │ └── form-select.svg │ ├── async.js │ ├── less.less │ └── async-treeshaken.js ├── assets │ ├── static │ │ ├── bar │ │ ├── foo.txt │ │ ├── foo.json │ │ ├── raw.css │ │ ├── foo.css │ │ ├── icon.png │ │ ├── import-expression.js │ │ └── raw.js │ ├── foo.js │ ├── nested │ │ ├── foo.unknown │ │ ├── test.js │ │ ├── asset.png │ │ ├── icon.png │ │ └── テスト-測試-white space.png │ ├── テスト-測試-white space.js │ ├── asset │ │ ├── style.css │ │ └── main.js │ ├── css │ │ ├── foo.module.css │ │ ├── import.css │ │ └── nested │ │ │ └── at-imported-css-url.css │ ├── __tests__ │ │ ├── url-base │ │ │ └── vite.config.js │ │ ├── relative-base │ │ │ └── vite.config.js │ │ └── runtime-base │ │ │ └── vite.config.js │ ├── favicon.ico │ └── fonts │ │ ├── Inter-Italic.woff │ │ └── Inter-Italic.woff2 ├── resolve │ ├── dir-with-ext.js │ │ └── empty │ ├── exports-from-root │ │ ├── index.js │ │ ├── file.js │ │ ├── nested │ │ │ ├── file.js │ │ │ └── package.json │ │ └── package.json │ ├── exports-and-nested-scope │ │ ├── index.js │ │ └── nested-scope │ │ │ └── package.json │ ├── dir.js │ ├── exports-path │ │ ├── cjs.js │ │ ├── deep.json │ │ ├── deep.js │ │ ├── main.js │ │ └── dir │ │ │ └── dir.js │ ├── absolute.js │ ├── dir │ │ └── index.js │ ├── exports-legacy-fallback │ │ ├── index.js │ │ └── dir │ │ │ ├── index.js │ │ │ ├── index.mjs │ │ │ └── package.json │ ├── browser-field │ │ ├── out │ │ │ ├── cjs.node.js │ │ │ └── esm.browser.js │ │ ├── no-ext.js │ │ ├── not-browser.js │ │ ├── multiple.dot.path.js │ │ ├── no-ext-index │ │ │ └── index.js │ │ └── bare-import.js │ ├── config-dep.cjs │ ├── custom-condition │ │ ├── index.js │ │ └── index.custom.js │ ├── custom-ext.es │ ├── custom-main-field │ │ ├── index.js │ │ ├── index.custom.js │ │ └── package.json │ ├── imports-path │ │ ├── same-level.js │ │ ├── slash │ │ │ └── index.js │ │ ├── star │ │ │ └── index.js │ │ ├── top-level.js │ │ ├── nested-path.js │ │ └── other-pkg │ │ │ ├── nest │ │ │ └── index.js │ │ │ └── package.json │ ├── drive-relative.js │ ├── exact-extension │ │ ├── file.js.js │ │ ├── file.js │ │ └── file.json.js │ ├── browser-field-bare-import-fail │ │ ├── main.js │ │ ├── module.js │ │ └── package.json │ ├── browser-field-bare-import-success │ │ ├── main.js │ │ ├── module.js │ │ └── package.json │ ├── exports-env │ │ ├── browser.js │ │ ├── fallback.umd.js │ │ ├── browser.mjs │ │ └── browser.prod.mjs │ ├── inline-package │ │ ├── inline.js │ │ └── package.json │ ├── dir-with-ext │ │ └── index.js │ ├── browser-module-field2 │ │ ├── index.js │ │ ├── index.web.js │ │ └── package.json │ ├── browser-module-field3 │ │ ├── index.js │ │ ├── index.web.js │ │ └── package.json │ ├── browser-module-field1 │ │ ├── index.js │ │ └── index.web.js │ ├── sharp-dir │ │ ├── index.cjs │ │ └── package.json │ ├── ts-extension │ │ ├── hello.ts │ │ ├── hellotsx.tsx │ │ ├── hellojsx.tsx │ │ ├── hellomjs.mts │ │ └── hellocjs.cts │ ├── util │ │ ├── index.js │ │ └── bar.util.js │ ├── exports-with-module-condition │ │ ├── index.mjs │ │ ├── index.esm.js │ │ └── index.js │ ├── utf8-bom │ │ └── main.js │ ├── exports-with-module │ │ ├── import.mjs │ │ └── module.mjs │ ├── require-pkg-with-module-field │ │ ├── dep.cjs │ │ ├── package.json │ │ └── index.cjs │ └── exports-with-module-condition-required │ │ └── index.cjs ├── assets-sanitize │ ├── .env │ ├── +circle.svg │ ├── _circle.svg │ └── vite.config.js ├── dynamic-import │ ├── files │ │ ├── mxd.json │ │ └── mxd.js │ ├── pkg │ │ ├── index.js │ │ ├── pkg.css │ │ └── package.json │ ├── nested │ │ ├── shared.js │ │ ├── hello.js │ │ ├── self.js │ │ ├── nested │ │ │ └── self.js │ │ └── deps.js │ ├── alias │ │ ├── url.js │ │ ├── hi.js │ │ ├── hello.js │ │ └── worker.js │ ├── views │ │ ├── bar.js │ │ ├── qux.js │ │ ├── baz.js │ │ └── foo.js │ └── css │ │ └── index.css ├── fs-serve │ ├── root │ │ ├── src │ │ │ ├── .env │ │ │ ├── safe.txt │ │ │ ├── subdir │ │ │ │ └── safe.txt │ │ │ └── special characters åäö │ │ │ │ ├── safe.txt │ │ │ │ └── safe.json │ │ └── unsafe.txt │ ├── nested │ │ └── foo.js │ ├── safe.json │ ├── unsafe.json │ └── entry.js ├── ssr-deps │ ├── message │ ├── external-entry │ │ ├── index.js │ │ └── package.json │ ├── pkg-exports │ │ ├── index.js │ │ └── package.json │ ├── css-lib │ │ ├── index.css │ │ └── package.json │ ├── module-condition │ │ ├── import.mjs │ │ └── package.json │ ├── primitive-export │ │ ├── index.js │ │ └── package.json │ ├── require-absolute │ │ ├── foo.js │ │ ├── package.json │ │ └── index.js │ ├── no-external-cjs │ │ ├── index.js │ │ └── package.json │ ├── forwarded-export │ │ ├── index.js │ │ └── package.json │ ├── only-object-assigned-exports │ │ ├── index.js │ │ └── package.json │ ├── read-file-content │ │ ├── package.json │ │ └── index.js │ ├── src │ │ ├── isomorphic-module-browser.js │ │ └── isomorphic-module-server.js │ ├── define-property-exports │ │ ├── index.js │ │ └── package.json │ ├── import-builtin-cjs │ │ ├── index.js │ │ └── package.json │ ├── ts-transpiled-exports │ │ ├── package.json │ │ └── index.js │ ├── object-assigned-exports │ │ ├── package.json │ │ └── index.js │ ├── optimized-cjs-with-nested-external │ │ ├── index.js │ │ └── package.json │ ├── optimized-with-nested-external │ │ └── index.js │ ├── define-properties-exports │ │ ├── package.json │ │ └── index.js │ ├── no-external-css │ │ ├── index.css │ │ └── package.json │ ├── linked-no-external │ │ └── package.json │ ├── external-using-external-entry │ │ └── index.js │ ├── nested-external-cjs │ │ └── package.json │ ├── nested-external │ │ └── package.json │ └── non-optimized-with-nested-external │ │ └── index.js ├── html │ ├── invalid.html │ ├── inline │ │ ├── shared_a.html │ │ ├── dep1.js │ │ ├── dep2.js │ │ ├── dep3.js │ │ ├── shared.js │ │ ├── unique.js │ │ ├── shared-1.html │ │ ├── shared-2.html │ │ ├── unique.html │ │ └── common.js │ ├── main.css │ ├── shared.js │ ├── common.css │ ├── nested │ │ ├── nested.css │ │ ├── asset │ │ │ ├── style.css │ │ │ └── main.js │ │ └── nested.js │ ├── .env │ ├── link-props │ │ ├── print.css │ │ ├── screen.css │ │ └── index.html │ ├── unicode-path │ │ └── 中文-にほんご-한글-🌕🌖🌗 │ │ │ └── index.html │ ├── side-effects │ │ ├── sideEffects.js │ │ ├── index.html │ │ └── package.json │ ├── main.js │ ├── valid.js │ ├── zeroJS.html │ ├── noBody.html │ ├── noHead.html │ ├── scriptMixed.html │ ├── scriptAsync.html │ └── env.html ├── cli │ ├── index.js │ └── index.html ├── env-nested │ ├── .env │ ├── envs │ │ ├── .env.production │ │ └── .env.development │ └── vite.config.js ├── hmr │ ├── hmrNestedDep.js │ ├── missing-import │ │ ├── main.js │ │ ├── a.js │ │ └── index.html │ ├── customFile.js │ ├── global.css │ ├── optional-chaining │ │ └── child.js │ ├── importedVirtual.js │ ├── accept-exports │ │ ├── export-from │ │ │ ├── depA.ts │ │ │ ├── hub.ts │ │ │ ├── index.html │ │ │ └── export-from.ts │ │ ├── main-accepted │ │ │ ├── dep.ts │ │ │ ├── index.html │ │ │ ├── callback.ts │ │ │ └── main-accepted.ts │ │ ├── main-non-accepted │ │ │ ├── dep.ts │ │ │ ├── index.html │ │ │ ├── main-non-accepted.ts │ │ │ ├── default.ts │ │ │ └── named.ts │ │ ├── reexports.bak │ │ │ ├── source.ts │ │ │ ├── index.html │ │ │ └── reexports.ts │ │ ├── unused-exports │ │ │ ├── index.html │ │ │ ├── index.ts │ │ │ ├── used.ts │ │ │ └── unused.ts │ │ ├── star-imports │ │ │ └── index.html │ │ ├── side-effects │ │ │ └── index.html │ │ └── dynamic-imports │ │ │ └── index.html │ ├── importing-updated │ │ ├── index.js │ │ ├── a.js │ │ └── b.js │ ├── unicode-path │ │ └── 中文-にほんご-한글-🌕🌖🌗 │ │ │ └── index.html │ ├── icon.png │ ├── modules.d.ts │ ├── counter │ │ ├── index.html │ │ └── dep.ts │ ├── file-delete-restore │ │ ├── index.js │ │ └── child.js │ └── invalidation │ │ ├── parent.js │ │ └── child.js ├── optimize-deps │ ├── dep-optimize-with-glob │ │ ├── index.js │ │ ├── named.js │ │ ├── glob │ │ │ ├── bar.js │ │ │ ├── foo.js │ │ │ └── nested │ │ │ │ └── baz.js │ │ └── package.json │ ├── dep-optimize-exports-with-glob │ │ ├── glob │ │ │ ├── bar.js │ │ │ ├── foo.js │ │ │ └── nested │ │ │ │ └── baz.js │ │ ├── index.js │ │ └── named.js │ ├── dep-css-require │ │ ├── index.cjs │ │ ├── style.css │ │ ├── mod.module.css │ │ ├── mod.cjs │ │ └── package.json │ ├── dep-linked │ │ ├── index.js │ │ └── package.json │ ├── .hidden-dir │ │ └── foo.js │ ├── dep-relative-to-main │ │ ├── entry.js │ │ ├── lib │ │ │ └── main.js │ │ └── package.json │ ├── dep-cjs-with-assets │ │ ├── foo.css │ │ ├── index.js │ │ └── package.json │ ├── dep-linked-include │ │ ├── test.css │ │ ├── Test.vue │ │ ├── foo.js │ │ └── package.json │ ├── dep-not-js │ │ ├── foo.js │ │ ├── index.notjs │ │ └── package.json │ ├── dep-cjs-browser-field-bare │ │ ├── events-shim.js │ │ ├── index.js │ │ ├── internal.js │ │ └── package.json │ ├── dep-node-env │ │ ├── index.js │ │ └── package.json │ ├── dep-with-dynamic-import │ │ ├── dynamic.js │ │ ├── index.js │ │ └── package.json │ ├── dep-cjs-compiled-from-cjs │ │ ├── index.js │ │ └── package.json │ ├── added-in-entries │ │ ├── index.js │ │ └── package.json │ ├── nested-include │ │ ├── index.js │ │ └── package.json │ ├── dep-esbuild-plugin-transform │ │ ├── index.js │ │ └── package.json │ ├── nested-exclude │ │ └── index.js │ ├── index.astro │ ├── dep-non-optimized │ │ ├── package.json │ │ └── index.js │ ├── glob │ │ └── foo.js │ ├── non-optimizable-include │ │ ├── index.css │ │ └── package.json │ ├── dep-cjs-compiled-from-esm │ │ ├── package.json │ │ └── index.js │ ├── dep-with-builtin-module-cjs │ │ └── package.json │ ├── dep-with-optional-peer-dep │ │ └── index.js │ ├── dep-with-builtin-module-esm │ │ └── package.json │ └── dep-alias-using-absolute-path │ │ └── package.json ├── build-old │ ├── dynamic.js │ └── vite.config.js ├── css-codesplit-cjs │ ├── other.js │ ├── main.css │ ├── style.css │ ├── index.html │ └── main.js ├── css-codesplit │ ├── style2.js │ ├── main.css │ ├── style.css │ ├── style2.css │ ├── async.css │ ├── chunk.css │ ├── inline.css │ ├── mod.module.css │ ├── order │ │ ├── base.css │ │ ├── dynamic.css │ │ ├── insert.js │ │ └── index.js │ └── other.js ├── define │ ├── data.json │ └── commonjs-dep │ │ ├── package.json │ │ └── index.js ├── glob-import │ ├── dir │ │ ├── alias.js │ │ ├── foo.js │ │ ├── baz.json │ │ ├── foo.css │ │ ├── node_modules │ │ │ └── hoge.js │ │ ├── quote'.js │ │ ├── nested │ │ │ └── bar.js │ │ └── index.js │ ├── imports-path │ │ ├── bar.js │ │ └── foo.js │ ├── escape │ │ ├── [brackets] │ │ │ ├── mod │ │ │ │ └── index.js │ │ │ └── glob.js │ │ ├── {curlies} │ │ │ ├── mod │ │ │ │ └── index.js │ │ │ └── glob.js │ │ └── (parenthesis) │ │ │ ├── mod │ │ │ └── index.js │ │ │ └── glob.js │ ├── tree-shake.css │ ├── no-tree-shake.css │ └── side-effect │ │ ├── writedom.js │ │ └── writetodom.js ├── js-sourcemap │ ├── bar.ts │ ├── foo.js │ ├── dynamic │ │ ├── dynamic-foo.css │ │ └── dynamic-foo.js │ └── after-preload-dynamic.js ├── legacy │ ├── module.js │ ├── style.css │ ├── dynamic.css │ ├── nested │ │ └── index.html │ ├── worker.js │ ├── async.js │ ├── entry-server.js │ └── entry-server-sequential.js ├── lib │ ├── src │ │ ├── message.js │ │ ├── index.css │ │ ├── dynamic.css │ │ └── main2.js │ └── index.html ├── preserve-symlinks │ ├── module-a │ │ ├── linked.js │ │ ├── src │ │ │ ├── data.js │ │ │ └── index.js │ │ └── package.json │ └── src │ │ └── main.js ├── alias │ ├── dir │ │ ├── test.css │ │ ├── test.js │ │ ├── module │ │ │ ├── index.js │ │ │ └── package.json │ │ └── from-script-src.js │ ├── test.js │ └── customResolver.js ├── import-assertion │ ├── data.json │ └── import-assertion-dep │ │ ├── data.json │ │ ├── index.js │ │ └── package.json ├── json │ ├── hmr.json │ ├── test.json │ ├── json-module │ │ ├── index.json │ │ └── package.json │ ├── public │ │ └── public.json │ └── json-bom │ │ └── has-bom.json ├── preload │ ├── public │ │ └── preloaded.js │ ├── src │ │ ├── hello.module.css │ │ ├── chunk.js │ │ ├── about.js │ │ └── hello.js │ ├── dep-a │ │ ├── index.js │ │ └── package.json │ ├── __tests__ │ │ ├── resolve-deps │ │ │ └── vite.config.js │ │ └── preload-disabled │ │ │ └── vite.config.js │ └── dep-including-a │ │ ├── index.js │ │ └── package.json ├── ssr-webworker │ └── src │ │ └── dynamic.js ├── worker │ ├── modules │ │ ├── module0.js │ │ ├── module1.js │ │ ├── module3.js │ │ ├── test-plugin.js │ │ ├── workerImport.ts │ │ └── module2.js │ ├── public │ │ └── classic.js │ ├── dep-to-optimize │ │ ├── index.js │ │ └── package.json │ ├── simple-worker.js │ ├── __tests__ │ │ ├── es │ │ │ └── vite.config.js │ │ ├── iife │ │ │ └── vite.config.js │ │ ├── relative-base │ │ │ └── vite.config.js │ │ ├── relative-base-iife │ │ │ └── vite.config.js │ │ ├── sourcemap │ │ │ └── vite.config.js │ │ ├── sourcemap-hidden │ │ │ └── vite.config.js │ │ └── sourcemap-inline │ │ │ └── vite.config.js │ ├── worker │ │ └── main.js │ ├── sub-worker.js │ ├── module-and-worker.js │ ├── emit-chunk-dynamic-import-worker.js │ ├── importMetaGlob.worker.js │ ├── url-worker.js │ ├── url-shared-worker.js │ └── importMetaGlobEager.worker.js ├── css-sourcemap │ ├── linked.css │ ├── imported.css │ ├── imported.sss │ ├── be-imported.css │ ├── imported.sass │ ├── input-map.src.css │ ├── imported.module.sass │ ├── imported.styl │ ├── imported.less │ ├── input-map.css │ ├── linked-with-import.css │ ├── imported-with-import.css │ └── input-map.css.map ├── multiple-entrypoints │ ├── dynamic-a.js │ ├── dynamic-b.js │ ├── reference.scss │ ├── reference.js │ ├── index.html │ ├── entrypoints │ │ ├── a24.js │ │ ├── a23.js │ │ └── a22.js │ └── index.js ├── ssr-resolve │ ├── deep-import │ │ ├── foo │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── utils │ │ │ └── bar.js │ │ ├── index.js │ │ ├── bar │ │ │ └── package.json │ │ └── package.json │ ├── pkg-exports │ │ ├── index.js │ │ ├── entry.js │ │ └── package.json │ ├── entries │ │ ├── file.js │ │ ├── dir │ │ │ └── index.js │ │ └── package.json │ └── vite.config.js ├── nested-deps │ ├── test-package-a │ │ ├── index.js │ │ └── package.json │ ├── test-package-f │ │ ├── index.js │ │ └── package.json │ ├── test-package-c │ │ ├── index-es.js │ │ ├── side.js │ │ ├── index.js │ │ └── package.json │ ├── test-package-b │ │ ├── node_modules │ │ │ └── test-package-a │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ ├── index.js │ │ └── package.json │ ├── test-package-d │ │ ├── test-package-d-nested │ │ │ ├── index.js │ │ │ └── package.json │ │ └── index.js │ └── test-package-e │ │ ├── index.js │ │ ├── test-package-e-included │ │ └── index.js │ │ └── test-package-e-excluded │ │ ├── package.json │ │ └── index.js ├── resolve-config │ └── root │ │ └── index.js ├── ssr-noexternal │ ├── external-cjs │ │ ├── require.cjs │ │ ├── import.mjs │ │ └── package.json │ └── require-external-cjs │ │ └── main.js ├── env │ ├── .env.development │ ├── .env.production │ └── index.js ├── resolve-linked │ ├── dep.js │ ├── src │ │ └── index.js │ └── package.json ├── ssr-html │ └── src │ │ ├── importedVirtual.js │ │ ├── error.js │ │ └── error.ts ├── backend-integration │ ├── frontend │ │ ├── styles │ │ │ └── tailwind.css │ │ ├── entrypoints │ │ │ └── nested │ │ │ │ └── blue.scss │ │ └── images │ │ │ └── logo.png │ ├── dir │ │ └── foo.css │ └── references.css ├── config │ ├── __tests__ │ │ └── serve.ts │ └── packages │ │ ├── plugin-module-condition │ │ ├── index.mjs │ │ ├── index.cjs │ │ ├── module.mjs │ │ └── index.d.ts │ │ ├── siblings │ │ ├── foo.ts │ │ └── package.json │ │ └── entry │ │ ├── vite.config.ts │ │ └── package.json ├── proxy-hmr │ ├── other-app │ │ ├── index.html │ │ ├── vite.config.js │ │ └── package.json │ ├── index.html │ └── package.json ├── cli-module │ ├── index.js │ └── index.html ├── css-dynamic-import │ ├── dynamic.css │ ├── static.css │ ├── static.js │ ├── index.html │ ├── package.json │ └── dynamic.js ├── css-lightningcss │ ├── mod.module.css │ ├── composed.module.css │ ├── linked-at-import.css │ ├── imported-at-import.css │ ├── inline.module.css │ ├── minify.css │ ├── inlined.css │ ├── ok.png │ ├── composes-path-resolving.module.css │ ├── linked.css │ └── imported.css ├── optimize-missing-deps │ ├── multi-entry-dep │ │ ├── index.browser.js │ │ ├── index.js │ │ └── package.json │ ├── main.js │ └── missing-dep │ │ └── index.js ├── ssr │ ├── src │ │ ├── circular-dep-init │ │ │ ├── module-a.js │ │ │ ├── circular-dep-init.js │ │ │ ├── README.md │ │ │ └── module-b.js │ │ └── forked-deadlock │ │ │ ├── stuck-module.js │ │ │ ├── fuse-stuck-bridge-module.js │ │ │ ├── middle-module.js │ │ │ └── deadlock-fuse-module.js │ └── vite.config.ts ├── transform-plugin │ ├── plugin-dep.js │ ├── index.html │ └── index.js ├── tsconfig-json-load-error │ ├── src │ │ └── main.ts │ └── has-error │ │ ├── main.ts │ │ └── tsconfig.json ├── minify │ ├── test.css │ ├── index.html │ ├── main.js │ └── vite.config.js ├── tailwind │ ├── index.css │ ├── src │ │ ├── utils.ts │ │ ├── assets │ │ │ └── logo.png │ │ ├── components │ │ │ └── PugTemplate.vue │ │ ├── main.js │ │ └── App.vue │ ├── public │ │ └── favicon.ico │ └── postcss.config.ts ├── wasm │ ├── heavy.wasm │ ├── light.wasm │ ├── add.wasm │ ├── worker.js │ └── vite.config.ts ├── tailwind-sourcemap │ ├── tailwind.css │ ├── tailwind.config.js │ ├── index.html │ └── vite.config.js ├── external │ ├── src │ │ └── main.js │ ├── dep-that-imports │ │ └── package.json │ └── dep-that-requires │ │ └── package.json ├── object-hooks │ ├── main.ts │ ├── index.html │ └── __tests__ │ │ └── object-hooks.spec.ts ├── tsconfig-json │ ├── src │ │ └── not-used-type.ts │ ├── nested │ │ └── not-used-type.ts │ └── nested-with-extends │ │ ├── not-used-type.ts │ │ └── tsconfig.json ├── optimize-deps-no-discovery │ └── dep-no-discovery │ │ ├── index.js │ │ └── package.json ├── ssr-pug │ ├── src │ │ └── app.js │ └── index.pug └── extensions │ ├── index.html │ └── vite.config.js ├── .gitattributes ├── .eslintignore ├── packages ├── vite │ ├── src │ │ ├── node │ │ │ ├── __tests__ │ │ │ │ ├── packages │ │ │ │ │ ├── noname │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── name │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── module │ │ │ │ │ │ └── package.json │ │ │ │ │ └── build-project │ │ │ │ │ │ └── index.html │ │ │ │ ├── env │ │ │ │ │ ├── .env.testing │ │ │ │ │ ├── .env.existing │ │ │ │ │ ├── .env.production │ │ │ │ │ ├── .env.development │ │ │ │ │ └── .env │ │ │ │ ├── utils │ │ │ │ │ └── isFileReadable │ │ │ │ │ │ └── permission-test-file │ │ │ │ └── plugins │ │ │ │ │ ├── importGlob │ │ │ │ │ ├── fixture-a │ │ │ │ │ │ ├── .gitignore │ │ │ │ │ │ ├── modules │ │ │ │ │ │ │ ├── a.ts │ │ │ │ │ │ │ ├── b.ts │ │ │ │ │ │ │ └── index.ts │ │ │ │ │ │ ├── sibling.ts │ │ │ │ │ │ └── node_modules │ │ │ │ │ │ │ └── framework │ │ │ │ │ │ │ └── pages │ │ │ │ │ │ │ └── hello.page.js │ │ │ │ │ └── fixture-b │ │ │ │ │ │ ├── a.ts │ │ │ │ │ │ ├── b.ts │ │ │ │ │ │ └── index.ts │ │ │ │ │ └── dynamicImportVar │ │ │ │ │ └── mods │ │ │ │ │ ├── hi.js │ │ │ │ │ └── hello.js │ │ │ ├── server │ │ │ │ └── __tests__ │ │ │ │ │ └── fixtures │ │ │ │ │ ├── lerna │ │ │ │ │ ├── lerna.json │ │ │ │ │ └── nested │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── pnpm │ │ │ │ │ ├── pnpm-workspace.yaml │ │ │ │ │ ├── package.json │ │ │ │ │ └── nested │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── none │ │ │ │ │ └── nested │ │ │ │ │ │ └── package.json │ │ │ │ │ └── yarn │ │ │ │ │ ├── nested │ │ │ │ │ └── package.json │ │ │ │ │ └── package.json │ │ │ ├── ssr │ │ │ │ └── __tests__ │ │ │ │ │ ├── fixtures │ │ │ │ │ └── modules │ │ │ │ │ │ ├── has-error.js │ │ │ │ │ │ └── has-invalid-import.js │ │ │ │ │ └── ssrExternal.spec.ts │ │ │ └── tsconfig.json │ │ ├── types │ │ │ ├── package.json │ │ │ └── anymatch.d.ts │ │ └── client │ │ │ └── tsconfig.json │ └── types │ │ ├── package.json │ │ └── metadata.d.ts └── create-vite │ ├── index.js │ ├── template-lit-ts │ └── src │ │ └── vite-env.d.ts │ ├── template-react-ts │ ├── src │ │ └── vite-env.d.ts │ └── vite.config.ts │ ├── template-vue-ts │ ├── src │ │ ├── vite-env.d.ts │ │ └── main.ts │ ├── .vscode │ │ └── extensions.json │ └── vite.config.ts │ ├── template-preact-ts │ ├── src │ │ ├── vite-env.d.ts │ │ └── main.tsx │ └── vite.config.ts │ ├── template-vanilla-ts │ └── src │ │ └── vite-env.d.ts │ ├── template-svelte │ ├── .vscode │ │ └── extensions.json │ ├── src │ │ ├── vite-env.d.ts │ │ ├── main.js │ │ └── lib │ │ │ └── Counter.svelte │ └── vite.config.js │ ├── template-svelte-ts │ ├── .vscode │ │ └── extensions.json │ ├── src │ │ ├── vite-env.d.ts │ │ ├── main.ts │ │ └── lib │ │ │ └── Counter.svelte │ ├── vite.config.ts │ └── tsconfig.node.json │ ├── template-vue │ ├── .vscode │ │ └── extensions.json │ ├── src │ │ └── main.js │ └── vite.config.js │ ├── template-preact │ ├── src │ │ └── main.jsx │ └── vite.config.js │ └── template-react │ └── vite.config.js ├── pnpm-workspace.yaml ├── docs ├── public │ ├── vite.mp3 │ ├── og-image.png │ ├── ecosystem-vite4.png │ ├── logo-with-shadow.png │ ├── vite4-3-hmr-time.png │ ├── vite4-3-startup-time.png │ ├── og-image-announcing-vite3.png │ ├── og-image-announcing-vite4.png │ ├── og-image-announcing-vite4-3.png │ └── _headers └── images │ ├── diagrams.fig │ ├── v3-docs.png │ ├── vercel-configuration.png │ ├── vite-plugin-inspect.png │ ├── v3-open-issues-and-PRs.png │ └── v3-new-open-issues-and-PRs.png ├── .github ├── pr-workflow.png ├── issue-workflow.png ├── pr-workflow-dark.png └── issue-workflow-dark.png ├── scripts ├── publishCI.ts └── docs-check.sh ├── .stackblitz └── codeflow.json ├── .editorconfig ├── .git-blame-ignore-revs ├── .npmrc └── netlify.toml /playground/css/weapp.wxss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/css/pkg-dep/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /playground/assets/static/bar: -------------------------------------------------------------------------------- 1 | bar 2 | -------------------------------------------------------------------------------- /playground/assets/static/foo.txt: -------------------------------------------------------------------------------- 1 | foo -------------------------------------------------------------------------------- /playground/css/glob-dep.css: -------------------------------------------------------------------------------- 1 | @test; 2 | -------------------------------------------------------------------------------- /playground/resolve/dir-with-ext.js/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/assets-sanitize/.env: -------------------------------------------------------------------------------- 1 | KEY=unsafe 2 | -------------------------------------------------------------------------------- /playground/assets/foo.js: -------------------------------------------------------------------------------- 1 | console.log('hi') 2 | -------------------------------------------------------------------------------- /playground/dynamic-import/files/mxd.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /playground/fs-serve/root/src/.env: -------------------------------------------------------------------------------- 1 | KEY=unsafe 2 | -------------------------------------------------------------------------------- /playground/resolve/exports-from-root/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/ssr-deps/message: -------------------------------------------------------------------------------- 1 | File Content! 2 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | dist 2 | playground-temp 3 | temp 4 | -------------------------------------------------------------------------------- /playground/assets/nested/foo.unknown: -------------------------------------------------------------------------------- 1 | custom file 2 | -------------------------------------------------------------------------------- /playground/fs-serve/root/src/safe.txt: -------------------------------------------------------------------------------- 1 | KEY=safe 2 | -------------------------------------------------------------------------------- /playground/fs-serve/root/unsafe.txt: -------------------------------------------------------------------------------- 1 | KEY=unsafe 2 | -------------------------------------------------------------------------------- /playground/html/invalid.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /playground/resolve/exports-and-nested-scope/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/cli/index.js: -------------------------------------------------------------------------------- 1 | console.log('vite cli works!') 2 | -------------------------------------------------------------------------------- /playground/css/postcss-source-input.css: -------------------------------------------------------------------------------- 1 | @source-input; 2 | -------------------------------------------------------------------------------- /playground/env-nested/.env: -------------------------------------------------------------------------------- 1 | VITE_PARENT_ENV=dont_load_me -------------------------------------------------------------------------------- /playground/fs-serve/root/src/subdir/safe.txt: -------------------------------------------------------------------------------- 1 | KEY=safe 2 | -------------------------------------------------------------------------------- /playground/hmr/hmrNestedDep.js: -------------------------------------------------------------------------------- 1 | export const foo = 1 2 | -------------------------------------------------------------------------------- /playground/hmr/missing-import/main.js: -------------------------------------------------------------------------------- 1 | import './a.js' 2 | -------------------------------------------------------------------------------- /playground/html/inline/shared_a.html: -------------------------------------------------------------------------------- 1 |

inline a

2 | -------------------------------------------------------------------------------- /playground/html/main.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/html/shared.js: -------------------------------------------------------------------------------- 1 | export const msg = 'shared' 2 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-optimize-with-glob/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-optimize-with-glob/named.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/build-old/dynamic.js: -------------------------------------------------------------------------------- 1 | export default 'success' 2 | -------------------------------------------------------------------------------- /playground/css-codesplit-cjs/other.js: -------------------------------------------------------------------------------- 1 | import './style.css' 2 | -------------------------------------------------------------------------------- /playground/css-codesplit/style2.js: -------------------------------------------------------------------------------- 1 | import './style2.css' 2 | -------------------------------------------------------------------------------- /playground/css/async.css: -------------------------------------------------------------------------------- 1 | .async { 2 | color: teal; 3 | } 4 | -------------------------------------------------------------------------------- /playground/define/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": "__EXP__" 3 | } 4 | -------------------------------------------------------------------------------- /playground/dynamic-import/pkg/index.js: -------------------------------------------------------------------------------- 1 | import('./pkg.css') 2 | -------------------------------------------------------------------------------- /playground/fs-serve/nested/foo.js: -------------------------------------------------------------------------------- 1 | export const msg = 'foo' 2 | -------------------------------------------------------------------------------- /playground/fs-serve/safe.json: -------------------------------------------------------------------------------- 1 | { 2 | "msg": "safe" 3 | } 4 | -------------------------------------------------------------------------------- /playground/glob-import/dir/alias.js: -------------------------------------------------------------------------------- 1 | export default 'hi' 2 | -------------------------------------------------------------------------------- /playground/glob-import/dir/foo.js: -------------------------------------------------------------------------------- 1 | export const msg = 'foo' 2 | -------------------------------------------------------------------------------- /playground/hmr/customFile.js: -------------------------------------------------------------------------------- 1 | export const msg = 'custom' 2 | -------------------------------------------------------------------------------- /playground/html/common.css: -------------------------------------------------------------------------------- 1 | p { 2 | color: grey; 3 | } 4 | -------------------------------------------------------------------------------- /playground/js-sourcemap/bar.ts: -------------------------------------------------------------------------------- 1 | export const bar = 'bar' 2 | -------------------------------------------------------------------------------- /playground/js-sourcemap/foo.js: -------------------------------------------------------------------------------- 1 | export const foo = 'foo' 2 | -------------------------------------------------------------------------------- /playground/legacy/module.js: -------------------------------------------------------------------------------- 1 | export const module = 'module' 2 | -------------------------------------------------------------------------------- /playground/legacy/style.css: -------------------------------------------------------------------------------- 1 | #app { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/lib/src/message.js: -------------------------------------------------------------------------------- 1 | export default 'hello vite' 2 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-optimize-with-glob/glob/bar.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-optimize-with-glob/glob/foo.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/preserve-symlinks/module-a/linked.js: -------------------------------------------------------------------------------- 1 | ./src/index.js -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/packages/noname/package.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /packages/vite/src/node/server/__tests__/fixtures/lerna/lerna.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/alias/dir/test.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: grey; 3 | } 4 | -------------------------------------------------------------------------------- /playground/assets/static/foo.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": "bar" 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-codesplit/main.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-codesplit/style.css: -------------------------------------------------------------------------------- 1 | h2 { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/async/base.css: -------------------------------------------------------------------------------- 1 | .btn { 2 | color: black; 3 | } 4 | -------------------------------------------------------------------------------- /playground/dynamic-import/nested/shared.js: -------------------------------------------------------------------------------- 1 | export const n = 1 2 | -------------------------------------------------------------------------------- /playground/fs-serve/unsafe.json: -------------------------------------------------------------------------------- 1 | { 2 | "msg": "unsafe" 3 | } 4 | -------------------------------------------------------------------------------- /playground/glob-import/dir/baz.json: -------------------------------------------------------------------------------- 1 | { 2 | "msg": "baz" 3 | } 4 | -------------------------------------------------------------------------------- /playground/glob-import/imports-path/bar.js: -------------------------------------------------------------------------------- 1 | export default 'bar' 2 | -------------------------------------------------------------------------------- /playground/glob-import/imports-path/foo.js: -------------------------------------------------------------------------------- 1 | export default 'foo' 2 | -------------------------------------------------------------------------------- /playground/hmr/global.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: white; 3 | } 4 | -------------------------------------------------------------------------------- /playground/hmr/optional-chaining/child.js: -------------------------------------------------------------------------------- 1 | export const foo = 1 2 | -------------------------------------------------------------------------------- /playground/html/nested/nested.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/import-assertion/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": "bar" 3 | } 4 | -------------------------------------------------------------------------------- /playground/json/hmr.json: -------------------------------------------------------------------------------- 1 | { 2 | "hmr": "this is hmr json" 3 | } 4 | -------------------------------------------------------------------------------- /playground/json/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello": "this is json" 3 | } 4 | -------------------------------------------------------------------------------- /playground/lib/src/index.css: -------------------------------------------------------------------------------- 1 | .index { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-optimize-exports-with-glob/glob/bar.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-optimize-exports-with-glob/glob/foo.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-optimize-exports-with-glob/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-optimize-exports-with-glob/named.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-optimize-with-glob/glob/nested/baz.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/preload/public/preloaded.js: -------------------------------------------------------------------------------- 1 | console.log('preloaded') 2 | -------------------------------------------------------------------------------- /playground/resolve/dir.js: -------------------------------------------------------------------------------- 1 | export const file = '[success] dir.js' 2 | -------------------------------------------------------------------------------- /playground/resolve/exports-path/cjs.js: -------------------------------------------------------------------------------- 1 | exports.msg = 'from cjs' 2 | -------------------------------------------------------------------------------- /playground/ssr-webworker/src/dynamic.js: -------------------------------------------------------------------------------- 1 | export const foo = 'foo' 2 | -------------------------------------------------------------------------------- /playground/worker/modules/module0.js: -------------------------------------------------------------------------------- 1 | export default 'A string' 2 | -------------------------------------------------------------------------------- /playground/worker/public/classic.js: -------------------------------------------------------------------------------- 1 | self.constant = 'A classic' 2 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/env/.env.testing: -------------------------------------------------------------------------------- 1 | NODE_ENV=development -------------------------------------------------------------------------------- /packages/vite/src/node/server/__tests__/fixtures/pnpm/pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/assets/static/raw.css: -------------------------------------------------------------------------------- 1 | .raw-css { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/assets/テスト-測試-white space.js: -------------------------------------------------------------------------------- 1 | console.log('test Unicode') 2 | -------------------------------------------------------------------------------- /playground/css-codesplit-cjs/main.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-codesplit-cjs/style.css: -------------------------------------------------------------------------------- 1 | h2 { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-codesplit/style2.css: -------------------------------------------------------------------------------- 1 | h2 { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-sourcemap/linked.css: -------------------------------------------------------------------------------- 1 | .linked { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/aliased/foo.css: -------------------------------------------------------------------------------- 1 | .aliased { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/css-dep/index.styl: -------------------------------------------------------------------------------- 1 | .css-dep-stylus 2 | color red 3 | -------------------------------------------------------------------------------- /playground/css/glob-dep/bar.css: -------------------------------------------------------------------------------- 1 | .dir-dep-2 { 2 | color: grey; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/glob-dep/foo.css: -------------------------------------------------------------------------------- 1 | .dir-dep { 2 | color: grey; 3 | } 4 | -------------------------------------------------------------------------------- /playground/dynamic-import/alias/url.js: -------------------------------------------------------------------------------- 1 | export const url = 'load url' 2 | -------------------------------------------------------------------------------- /playground/dynamic-import/files/mxd.js: -------------------------------------------------------------------------------- 1 | export default function () {} 2 | -------------------------------------------------------------------------------- /playground/dynamic-import/views/bar.js: -------------------------------------------------------------------------------- 1 | export const msg = 'Bar view' 2 | -------------------------------------------------------------------------------- /playground/dynamic-import/views/qux.js: -------------------------------------------------------------------------------- 1 | export const msg = 'Qux view' 2 | -------------------------------------------------------------------------------- /playground/fs-serve/root/src/special characters åäö/safe.txt: -------------------------------------------------------------------------------- 1 | KEY=safe 2 | -------------------------------------------------------------------------------- /playground/glob-import/dir/foo.css: -------------------------------------------------------------------------------- 1 | .foo { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/hmr/importedVirtual.js: -------------------------------------------------------------------------------- 1 | export const virtual = '[success]' 2 | -------------------------------------------------------------------------------- /playground/html/.env: -------------------------------------------------------------------------------- 1 | VITE_FOO=bar 2 | VITE_FAVICON_URL=/sprite.svg 3 | -------------------------------------------------------------------------------- /playground/json/json-module/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello": "hi" 3 | } 4 | -------------------------------------------------------------------------------- /playground/legacy/dynamic.css: -------------------------------------------------------------------------------- 1 | #dynamic-css { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/multiple-entrypoints/dynamic-a.js: -------------------------------------------------------------------------------- 1 | import './reference' 2 | -------------------------------------------------------------------------------- /playground/multiple-entrypoints/dynamic-b.js: -------------------------------------------------------------------------------- 1 | import './reference' 2 | -------------------------------------------------------------------------------- /playground/preload/src/hello.module.css: -------------------------------------------------------------------------------- 1 | .h1 { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/resolve/absolute.js: -------------------------------------------------------------------------------- 1 | export default '[success] absolute' 2 | -------------------------------------------------------------------------------- /playground/resolve/dir/index.js: -------------------------------------------------------------------------------- 1 | export const file = 'dir/index.js' 2 | -------------------------------------------------------------------------------- /playground/resolve/exports-legacy-fallback/index.js: -------------------------------------------------------------------------------- 1 | export default 5 2 | -------------------------------------------------------------------------------- /playground/resolve/exports-path/deep.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": "json" 3 | } 4 | -------------------------------------------------------------------------------- /playground/ssr-deps/external-entry/index.js: -------------------------------------------------------------------------------- 1 | export default undefined 2 | -------------------------------------------------------------------------------- /playground/ssr-deps/pkg-exports/index.js: -------------------------------------------------------------------------------- 1 | export default undefined 2 | -------------------------------------------------------------------------------- /playground/ssr-resolve/deep-import/foo/index.js: -------------------------------------------------------------------------------- 1 | export default 'foo' 2 | -------------------------------------------------------------------------------- /playground/ssr-resolve/deep-import/utils/bar.js: -------------------------------------------------------------------------------- 1 | export default 'bar' 2 | -------------------------------------------------------------------------------- /playground/worker/modules/module1.js: -------------------------------------------------------------------------------- 1 | export const msg1 = 'module1' 2 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/utils/isFileReadable/permission-test-file: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/alias/test.js: -------------------------------------------------------------------------------- 1 | export const msg = `[success] alias to fs path` 2 | -------------------------------------------------------------------------------- /playground/assets/asset/style.css: -------------------------------------------------------------------------------- 1 | .relative-css { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/assets/css/foo.module.css: -------------------------------------------------------------------------------- 1 | .foo-module { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/assets/css/import.css: -------------------------------------------------------------------------------- 1 | .import-css { 2 | color: #0088ff; 3 | } 4 | -------------------------------------------------------------------------------- /playground/assets/static/foo.css: -------------------------------------------------------------------------------- 1 | .foo-public { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-codesplit/async.css: -------------------------------------------------------------------------------- 1 | .dynamic { 2 | color: green; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-codesplit/chunk.css: -------------------------------------------------------------------------------- 1 | .chunk { 2 | color: magenta; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-codesplit/inline.css: -------------------------------------------------------------------------------- 1 | .inline { 2 | color: yellow; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-codesplit/mod.module.css: -------------------------------------------------------------------------------- 1 | .mod { 2 | color: yellow; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-sourcemap/imported.css: -------------------------------------------------------------------------------- 1 | .imported { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-sourcemap/imported.sss: -------------------------------------------------------------------------------- 1 | .imported-sugarss 2 | color: red 3 | -------------------------------------------------------------------------------- /playground/css/async/async-1.css: -------------------------------------------------------------------------------- 1 | .async-blue { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/async/async-2.css: -------------------------------------------------------------------------------- 1 | .async-green { 2 | color: green; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/css-dep/index.css: -------------------------------------------------------------------------------- 1 | .css-dep { 2 | color: purple; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/css-dep/index.js: -------------------------------------------------------------------------------- 1 | throw new Error('should not be imported') 2 | -------------------------------------------------------------------------------- /playground/css/css-js-dep/foo.css: -------------------------------------------------------------------------------- 1 | .css-js-dep { 2 | color: green; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/glob-import/foo.css: -------------------------------------------------------------------------------- 1 | .dir-import { 2 | color: grey; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/mod.module.css: -------------------------------------------------------------------------------- 1 | .apply-color { 2 | color: turquoise; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/raw-imported.css: -------------------------------------------------------------------------------- 1 | .raw-imported { 2 | color: yellow; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/same-name/sub1/sub.css: -------------------------------------------------------------------------------- 1 | .sub1-sub { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/same-name/sub2/sub.css: -------------------------------------------------------------------------------- 1 | .sub2-sub { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/dynamic-import/pkg/pkg.css: -------------------------------------------------------------------------------- 1 | .pkg-css { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/glob-import/dir/node_modules/hoge.js: -------------------------------------------------------------------------------- 1 | export const msg = 'hoge' 2 | -------------------------------------------------------------------------------- /playground/glob-import/dir/quote'.js: -------------------------------------------------------------------------------- 1 | export const msg = 'single-quote' 2 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/export-from/depA.ts: -------------------------------------------------------------------------------- 1 | export const a = 'Ax' 2 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/export-from/hub.ts: -------------------------------------------------------------------------------- 1 | export * from './depA' 2 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/main-accepted/dep.ts: -------------------------------------------------------------------------------- 1 | export default 'dep0' 2 | -------------------------------------------------------------------------------- /playground/hmr/importing-updated/index.js: -------------------------------------------------------------------------------- 1 | import './a' 2 | import './b' 3 | -------------------------------------------------------------------------------- /playground/json/public/public.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello": "this is json" 3 | } 4 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-a/index.js: -------------------------------------------------------------------------------- 1 | export default 'A@2.0.0' 2 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-f/index.js: -------------------------------------------------------------------------------- 1 | export default 'F@2.0.0' 2 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-css-require/index.cjs: -------------------------------------------------------------------------------- 1 | require('./style.css') 2 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-linked/index.js: -------------------------------------------------------------------------------- 1 | export * from 'lodash-es' 2 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-optimize-exports-with-glob/glob/nested/baz.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/preload/dep-a/index.js: -------------------------------------------------------------------------------- 1 | export const msgFromA = 'From dep-a' 2 | -------------------------------------------------------------------------------- /playground/resolve-config/root/index.js: -------------------------------------------------------------------------------- 1 | console.log(__CONFIG_LOADED__) 2 | -------------------------------------------------------------------------------- /playground/resolve/browser-field/out/cjs.node.js: -------------------------------------------------------------------------------- 1 | export default 'fail' 2 | -------------------------------------------------------------------------------- /playground/resolve/config-dep.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | a: 1, 3 | } 4 | -------------------------------------------------------------------------------- /playground/resolve/custom-condition/index.js: -------------------------------------------------------------------------------- 1 | export const msg = '[fail]' 2 | -------------------------------------------------------------------------------- /playground/resolve/custom-ext.es: -------------------------------------------------------------------------------- 1 | export const msg = `[success] custom ext` 2 | -------------------------------------------------------------------------------- /playground/resolve/custom-main-field/index.js: -------------------------------------------------------------------------------- 1 | export const msg = '[fail]' 2 | -------------------------------------------------------------------------------- /playground/resolve/imports-path/same-level.js: -------------------------------------------------------------------------------- 1 | export * from '#top-level' 2 | -------------------------------------------------------------------------------- /playground/ssr-deps/css-lib/index.css: -------------------------------------------------------------------------------- 1 | .css-lib { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/ssr-deps/module-condition/import.mjs: -------------------------------------------------------------------------------- 1 | export default '[success]' 2 | -------------------------------------------------------------------------------- /playground/ssr-noexternal/external-cjs/require.cjs: -------------------------------------------------------------------------------- 1 | module.exports = 'foo' 2 | -------------------------------------------------------------------------------- /playground/ssr-resolve/pkg-exports/index.js: -------------------------------------------------------------------------------- 1 | module.exports = undefined 2 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - 'packages/*' 3 | - 'playground/**' 4 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/env/.env.existing: -------------------------------------------------------------------------------- 1 | VITE_ENV_TEST_ENV=DOTENV 2 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/env/.env.production: -------------------------------------------------------------------------------- 1 | VITE_APP_BASE_ROUTE=/app/ 2 | -------------------------------------------------------------------------------- /playground/alias/dir/test.js: -------------------------------------------------------------------------------- 1 | export const msg = `[success] alias to directory` 2 | -------------------------------------------------------------------------------- /playground/css-codesplit/order/base.css: -------------------------------------------------------------------------------- 1 | .order-bulk { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-sourcemap/be-imported.css: -------------------------------------------------------------------------------- 1 | .be-imported { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/aliased/bar.module.css: -------------------------------------------------------------------------------- 1 | .aliasedModule { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/async/async-3.module.css: -------------------------------------------------------------------------------- 1 | .async-pink { 2 | color: pink; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/composed.module.css: -------------------------------------------------------------------------------- 1 | .apply-color { 2 | color: turquoise; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/composed.module.less: -------------------------------------------------------------------------------- 1 | .apply-color { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/css-dep/index.scss: -------------------------------------------------------------------------------- 1 | .css-dep-sass { 2 | color: orange; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/glob-import/bar.css: -------------------------------------------------------------------------------- 1 | .dir-import-2 { 2 | color: grey; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/linked-at-import.css: -------------------------------------------------------------------------------- 1 | .linked-at-import { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/mod.module.scss: -------------------------------------------------------------------------------- 1 | .apply-color { 2 | color: orangered; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/nested/_partial.scss: -------------------------------------------------------------------------------- 1 | .sass-partial { 2 | color: orchid; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/nested/css-in-less.css: -------------------------------------------------------------------------------- 1 | .css-in-less { 2 | color: yellow; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/nested/css-in-scss.css: -------------------------------------------------------------------------------- 1 | .css-in-scss { 2 | color: orange; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/pkg-dep/_index.scss: -------------------------------------------------------------------------------- 1 | .sass-dep { 2 | color: lavender; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/unsupported.css: -------------------------------------------------------------------------------- 1 | .unsupported { 2 | overflow-x: hidden; 3 | } 4 | -------------------------------------------------------------------------------- /playground/env/.env.development: -------------------------------------------------------------------------------- 1 | VITE_EFFECTIVE_MODE_FILE_NAME=.env.development 2 | -------------------------------------------------------------------------------- /playground/env/.env.production: -------------------------------------------------------------------------------- 1 | VITE_EFFECTIVE_MODE_FILE_NAME=.env.production 2 | -------------------------------------------------------------------------------- /playground/glob-import/escape/[brackets]/mod/index.js: -------------------------------------------------------------------------------- 1 | export const msg = 'foo' 2 | -------------------------------------------------------------------------------- /playground/glob-import/escape/{curlies}/mod/index.js: -------------------------------------------------------------------------------- 1 | export const msg = 'foo' 2 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/main-non-accepted/dep.ts: -------------------------------------------------------------------------------- 1 | export default 'dep0' 2 | -------------------------------------------------------------------------------- /playground/html/link-props/print.css: -------------------------------------------------------------------------------- 1 | #link-props { 2 | color: green; 3 | } 4 | -------------------------------------------------------------------------------- /playground/html/link-props/screen.css: -------------------------------------------------------------------------------- 1 | #link-props { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/html/nested/asset/style.css: -------------------------------------------------------------------------------- 1 | .relative-css { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/html/unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html: -------------------------------------------------------------------------------- 1 |

Unicode path

2 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-c/index-es.js: -------------------------------------------------------------------------------- 1 | export default 'es-C@1.0.0' 2 | -------------------------------------------------------------------------------- /playground/optimize-deps/.hidden-dir/foo.js: -------------------------------------------------------------------------------- 1 | export const greeting = 'hello!' 2 | -------------------------------------------------------------------------------- /playground/resolve-linked/dep.js: -------------------------------------------------------------------------------- 1 | export const msg = 'dep from upper directory' 2 | -------------------------------------------------------------------------------- /playground/resolve/drive-relative.js: -------------------------------------------------------------------------------- 1 | export default '[success] drive relative' 2 | -------------------------------------------------------------------------------- /playground/resolve/exact-extension/file.js.js: -------------------------------------------------------------------------------- 1 | export const file = 'file.js.js' 2 | -------------------------------------------------------------------------------- /playground/ssr-deps/primitive-export/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 'Hello World!' 2 | -------------------------------------------------------------------------------- /playground/ssr-html/src/importedVirtual.js: -------------------------------------------------------------------------------- 1 | export const virtual = '[success]' 2 | -------------------------------------------------------------------------------- /playground/worker/dep-to-optimize/index.js: -------------------------------------------------------------------------------- 1 | export const msg = 'dep-to-optimize' 2 | -------------------------------------------------------------------------------- /packages/create-vite/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import './dist/index.mjs' 4 | -------------------------------------------------------------------------------- /packages/vite/src/node/ssr/__tests__/fixtures/modules/has-error.js: -------------------------------------------------------------------------------- 1 | throw new Error() 2 | -------------------------------------------------------------------------------- /playground/alias/dir/module/index.js: -------------------------------------------------------------------------------- 1 | export const msg = `[success] aliased module` 2 | -------------------------------------------------------------------------------- /playground/assets/nested/test.js: -------------------------------------------------------------------------------- 1 | export default class a { 2 | name = 'a' 3 | } 4 | -------------------------------------------------------------------------------- /playground/backend-integration/frontend/styles/tailwind.css: -------------------------------------------------------------------------------- 1 | @tailwind utilities; 2 | -------------------------------------------------------------------------------- /playground/config/__tests__/serve.ts: -------------------------------------------------------------------------------- 1 | export function serve() { 2 | return 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-codesplit/order/dynamic.css: -------------------------------------------------------------------------------- 1 | .order-bulk { 2 | color: green; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-sourcemap/imported.sass: -------------------------------------------------------------------------------- 1 | .imported 2 | &-sass 3 | color: red 4 | -------------------------------------------------------------------------------- /playground/css-sourcemap/input-map.src.css: -------------------------------------------------------------------------------- 1 | .input-map { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/async-treeshaken.css: -------------------------------------------------------------------------------- 1 | .async-treeshaken { 2 | color: plum; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/composed.module.scss: -------------------------------------------------------------------------------- 1 | .apply-color { 2 | color: orangered; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/css-dep-exports/index.js: -------------------------------------------------------------------------------- 1 | throw new Error('should not be imported') 2 | -------------------------------------------------------------------------------- /playground/css/css-js-dep/bar.module.css: -------------------------------------------------------------------------------- 1 | .cssJsDepModule { 2 | color: green; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/css-proxy-dep/index.css: -------------------------------------------------------------------------------- 1 | @import '@vitejs/test-css-proxy-dep-nested'; 2 | -------------------------------------------------------------------------------- /playground/css/glob-dep/nested (dir)/baz.css: -------------------------------------------------------------------------------- 1 | .dir-dep-3 { 2 | color: grey; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/inline.module.css: -------------------------------------------------------------------------------- 1 | .apply-color-inline { 2 | color: turquoise; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/minify.css: -------------------------------------------------------------------------------- 1 | .test-minify { 2 | color: rgba(255, 255, 0, 0.7); 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/nested/css-in-less-2.less: -------------------------------------------------------------------------------- 1 | .css-in-less-2 { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/glob-import/escape/(parenthesis)/mod/index.js: -------------------------------------------------------------------------------- 1 | export const msg = 'foo' 2 | -------------------------------------------------------------------------------- /playground/hmr/unicode-path/中文-にほんご-한글-🌕🌖🌗/index.html: -------------------------------------------------------------------------------- 1 |
title
2 | -------------------------------------------------------------------------------- /playground/html/inline/dep1.js: -------------------------------------------------------------------------------- 1 | import { log } from './common' 2 | 3 | log('dep1') 4 | -------------------------------------------------------------------------------- /playground/html/inline/dep2.js: -------------------------------------------------------------------------------- 1 | import { log } from './common' 2 | 3 | log('dep2') 4 | -------------------------------------------------------------------------------- /playground/multiple-entrypoints/reference.scss: -------------------------------------------------------------------------------- 1 | .content { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/preload/src/chunk.js: -------------------------------------------------------------------------------- 1 | export default '[success] message from chunk.js' 2 | -------------------------------------------------------------------------------- /playground/proxy-hmr/other-app/index.html: -------------------------------------------------------------------------------- 1 | other app 2 | -------------------------------------------------------------------------------- /playground/resolve/browser-field-bare-import-fail/main.js: -------------------------------------------------------------------------------- 1 | export default '[fail]' 2 | -------------------------------------------------------------------------------- /playground/resolve/browser-field-bare-import-fail/module.js: -------------------------------------------------------------------------------- 1 | export default '[fail]' 2 | -------------------------------------------------------------------------------- /playground/resolve/browser-field-bare-import-success/main.js: -------------------------------------------------------------------------------- 1 | export default '[fail]' 2 | -------------------------------------------------------------------------------- /playground/resolve/exact-extension/file.js: -------------------------------------------------------------------------------- 1 | export const file = '[success] file.js' 2 | -------------------------------------------------------------------------------- /playground/resolve/exports-env/browser.js: -------------------------------------------------------------------------------- 1 | export const msg = 'fail (browser.js)' 2 | -------------------------------------------------------------------------------- /playground/ssr-deps/require-absolute/foo.js: -------------------------------------------------------------------------------- 1 | module.exports.hello = 'Hello World!' 2 | -------------------------------------------------------------------------------- /playground/ssr-resolve/pkg-exports/entry.js: -------------------------------------------------------------------------------- 1 | module.exports = 'pkg-exports entry' 2 | -------------------------------------------------------------------------------- /playground/worker/simple-worker.js: -------------------------------------------------------------------------------- 1 | self.postMessage('Hello from simple worker!') 2 | -------------------------------------------------------------------------------- /docs/public/vite.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/docs/public/vite.mp3 -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/packages/name/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mylib" 3 | } 4 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/plugins/importGlob/fixture-a/.gitignore: -------------------------------------------------------------------------------- 1 | !/node_modules/ 2 | -------------------------------------------------------------------------------- /playground/backend-integration/dir/foo.css: -------------------------------------------------------------------------------- 1 | .windows-path-foo { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/cli-module/index.js: -------------------------------------------------------------------------------- 1 | console.log('vite cli in "type":"module" package works!') 2 | -------------------------------------------------------------------------------- /playground/css-dynamic-import/dynamic.css: -------------------------------------------------------------------------------- 1 | .css-dynamic-import { 2 | color: green; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-dynamic-import/static.css: -------------------------------------------------------------------------------- 1 | .css-dynamic-import { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-lightningcss/mod.module.css: -------------------------------------------------------------------------------- 1 | .apply-color { 2 | color: turquoise; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/charset.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | 3 | .utf8 { 4 | color: green; 5 | } 6 | -------------------------------------------------------------------------------- /playground/css/css-dep-exports/style.css: -------------------------------------------------------------------------------- 1 | .css-dep-exports { 2 | color: purple; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/css-proxy-dep-nested/index.css: -------------------------------------------------------------------------------- 1 | .css-proxy-dep { 2 | color: purple; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/imported-at-import.css: -------------------------------------------------------------------------------- 1 | .imported-at-import { 2 | color: purple; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/css/ok.png -------------------------------------------------------------------------------- /playground/env-nested/envs/.env.production: -------------------------------------------------------------------------------- 1 | VITE_EFFECTIVE_MODE_FILE_NAME=.env.production 2 | -------------------------------------------------------------------------------- /playground/fs-serve/root/src/special characters åäö/safe.json: -------------------------------------------------------------------------------- 1 | { 2 | "msg": "safe" 3 | } 4 | -------------------------------------------------------------------------------- /playground/glob-import/tree-shake.css: -------------------------------------------------------------------------------- 1 | .tree-shake-eager-css { 2 | color: orange; 3 | } 4 | -------------------------------------------------------------------------------- /playground/import-assertion/import-assertion-dep/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello": "world" 3 | } 4 | -------------------------------------------------------------------------------- /playground/js-sourcemap/dynamic/dynamic-foo.css: -------------------------------------------------------------------------------- 1 | .dynamic-foo { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-css-require/style.css: -------------------------------------------------------------------------------- 1 | .css-require { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-relative-to-main/entry.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./') 2 | -------------------------------------------------------------------------------- /playground/optimize-missing-deps/multi-entry-dep/index.browser.js: -------------------------------------------------------------------------------- 1 | exports.name = 'Client' 2 | -------------------------------------------------------------------------------- /playground/resolve/browser-field-bare-import-success/module.js: -------------------------------------------------------------------------------- 1 | export default '[success]' 2 | -------------------------------------------------------------------------------- /playground/ssr-noexternal/external-cjs/import.mjs: -------------------------------------------------------------------------------- 1 | throw new Error('shouldnt be loaded') 2 | -------------------------------------------------------------------------------- /playground/ssr/src/circular-dep-init/module-a.js: -------------------------------------------------------------------------------- 1 | export const valueA = 'circ-dep-init-a' 2 | -------------------------------------------------------------------------------- /playground/transform-plugin/plugin-dep.js: -------------------------------------------------------------------------------- 1 | // Empty file for detecting changes in tests 2 | -------------------------------------------------------------------------------- /.github/pr-workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/.github/pr-workflow.png -------------------------------------------------------------------------------- /docs/images/diagrams.fig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/docs/images/diagrams.fig -------------------------------------------------------------------------------- /docs/images/v3-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/docs/images/v3-docs.png -------------------------------------------------------------------------------- /docs/public/og-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/docs/public/og-image.png -------------------------------------------------------------------------------- /packages/create-vite/template-lit-ts/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/create-vite/template-react-ts/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/create-vite/template-vue-ts/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/packages/module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module" 3 | } 4 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/plugins/importGlob/fixture-b/a.ts: -------------------------------------------------------------------------------- 1 | export const name = 'a' 2 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/plugins/importGlob/fixture-b/b.ts: -------------------------------------------------------------------------------- 1 | export const name = 'b' 2 | -------------------------------------------------------------------------------- /playground/config/packages/plugin-module-condition/index.mjs: -------------------------------------------------------------------------------- 1 | export default 'import condition' 2 | -------------------------------------------------------------------------------- /playground/css-lightningcss/composed.module.css: -------------------------------------------------------------------------------- 1 | .apply-color { 2 | color: turquoise; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-lightningcss/linked-at-import.css: -------------------------------------------------------------------------------- 1 | .linked-at-import { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-sourcemap/imported.module.sass: -------------------------------------------------------------------------------- 1 | .imported 2 | &-sass-module 3 | color: red 4 | -------------------------------------------------------------------------------- /playground/css-sourcemap/imported.styl: -------------------------------------------------------------------------------- 1 | .imported 2 | &-stylus 3 | color blue-red-mixed 4 | -------------------------------------------------------------------------------- /playground/css/css-dep-exports/style.scss: -------------------------------------------------------------------------------- 1 | .css-dep-exports-sass { 2 | color: orange; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/jsfile.css.js: -------------------------------------------------------------------------------- 1 | const message = 'from jsfile.css.js' 2 | export default message 3 | -------------------------------------------------------------------------------- /playground/css/postcss-caching/blue-app/imported.css: -------------------------------------------------------------------------------- 1 | .postcss-a { 2 | color: pink; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/postcss-caching/green-app/imported.css: -------------------------------------------------------------------------------- 1 | .postcss-b { 2 | color: pink; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/same-name/sub1/sub.js: -------------------------------------------------------------------------------- 1 | import './sub.css' 2 | 3 | export default 'sub1-name' 4 | -------------------------------------------------------------------------------- /playground/css/same-name/sub2/sub.js: -------------------------------------------------------------------------------- 1 | import './sub.css' 2 | 3 | export default 'sub2-name' 4 | -------------------------------------------------------------------------------- /playground/css/sugarss.sss: -------------------------------------------------------------------------------- 1 | @import '=/nested/nested.sss' 2 | 3 | .sugarss 4 | color: blue 5 | -------------------------------------------------------------------------------- /playground/dynamic-import/nested/hello.js: -------------------------------------------------------------------------------- 1 | export function hello() { 2 | return 'hello' 3 | } 4 | -------------------------------------------------------------------------------- /playground/dynamic-import/nested/self.js: -------------------------------------------------------------------------------- 1 | export const self = 'dynamic-import-self-content' 2 | -------------------------------------------------------------------------------- /playground/env-nested/envs/.env.development: -------------------------------------------------------------------------------- 1 | VITE_EFFECTIVE_MODE_FILE_NAME=.env.development 2 | -------------------------------------------------------------------------------- /playground/glob-import/no-tree-shake.css: -------------------------------------------------------------------------------- 1 | .no-tree-shake-eager-css { 2 | color: orange; 3 | } 4 | -------------------------------------------------------------------------------- /playground/hmr/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/hmr/icon.png -------------------------------------------------------------------------------- /playground/html/side-effects/sideEffects.js: -------------------------------------------------------------------------------- 1 | console.log('message from sideEffects script') 2 | -------------------------------------------------------------------------------- /playground/resolve/exact-extension/file.json.js: -------------------------------------------------------------------------------- 1 | export const file = '[success] file.json.js' 2 | -------------------------------------------------------------------------------- /playground/resolve/exports-env/fallback.umd.js: -------------------------------------------------------------------------------- 1 | export const msg = 'fail (fallback.umd.js)' 2 | -------------------------------------------------------------------------------- /playground/resolve/inline-package/inline.js: -------------------------------------------------------------------------------- 1 | export const msg = '[success] from inline package' 2 | -------------------------------------------------------------------------------- /playground/ssr-html/src/error.js: -------------------------------------------------------------------------------- 1 | export function error() { 2 | throw new Error('e') 3 | } 4 | -------------------------------------------------------------------------------- /playground/ssr-html/src/error.ts: -------------------------------------------------------------------------------- 1 | export function error() { 2 | throw new Error('e') 3 | } 4 | -------------------------------------------------------------------------------- /playground/tsconfig-json-load-error/src/main.ts: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | import '../has-error/main' 3 | -------------------------------------------------------------------------------- /playground/worker/__tests__/es/vite.config.js: -------------------------------------------------------------------------------- 1 | export { default } from '../../vite.config-es' 2 | -------------------------------------------------------------------------------- /.github/issue-workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/.github/issue-workflow.png -------------------------------------------------------------------------------- /packages/create-vite/template-preact-ts/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/create-vite/template-vanilla-ts/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/plugins/importGlob/fixture-a/modules/a.ts: -------------------------------------------------------------------------------- 1 | export const name = 'a' 2 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/plugins/importGlob/fixture-a/modules/b.ts: -------------------------------------------------------------------------------- 1 | export const name = 'b' 2 | -------------------------------------------------------------------------------- /packages/vite/src/node/server/__tests__/fixtures/pnpm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true 3 | } 4 | -------------------------------------------------------------------------------- /playground/alias/customResolver.js: -------------------------------------------------------------------------------- 1 | export const msg = `[success] alias to custom-resolver path` 2 | -------------------------------------------------------------------------------- /playground/config/packages/plugin-module-condition/index.cjs: -------------------------------------------------------------------------------- 1 | module.exports = 'require condition' 2 | -------------------------------------------------------------------------------- /playground/config/packages/plugin-module-condition/module.mjs: -------------------------------------------------------------------------------- 1 | export default 'module condition' 2 | -------------------------------------------------------------------------------- /playground/css-dynamic-import/static.js: -------------------------------------------------------------------------------- 1 | import './static.css' 2 | 3 | export const foo = 'foo' 4 | -------------------------------------------------------------------------------- /playground/css-lightningcss/imported-at-import.css: -------------------------------------------------------------------------------- 1 | .imported-at-import { 2 | color: purple; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-lightningcss/inline.module.css: -------------------------------------------------------------------------------- 1 | .apply-color-inline { 2 | color: turquoise; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css-lightningcss/minify.css: -------------------------------------------------------------------------------- 1 | .test-minify { 2 | color: rgba(255, 255, 0, 0.7); 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/imported.scss: -------------------------------------------------------------------------------- 1 | $color: red; 2 | 3 | .at-import-scss { 4 | color: $color; 5 | } 6 | -------------------------------------------------------------------------------- /playground/css/inlined.css: -------------------------------------------------------------------------------- 1 | .inlined { 2 | color: green; 3 | background: url('./ok.png'); 4 | } 5 | -------------------------------------------------------------------------------- /playground/hmr/missing-import/a.js: -------------------------------------------------------------------------------- 1 | import 'missing-modules' 2 | 3 | console.log('missing test') 4 | -------------------------------------------------------------------------------- /playground/minify/test.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | /* do not minify as red text */ 3 | color: #ff0000; 4 | } 5 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-b/node_modules/test-package-a/index.js: -------------------------------------------------------------------------------- 1 | export default 'A@1.0.0' 2 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-c/side.js: -------------------------------------------------------------------------------- 1 | export { default as C } from '@vitejs/test-package-c' 2 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-cjs-with-assets/foo.css: -------------------------------------------------------------------------------- 1 | .cjs-with-assets { 2 | color: blue; 3 | } 4 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-cjs-with-assets/index.js: -------------------------------------------------------------------------------- 1 | require('./foo.css') 2 | 3 | exports.a = 11 4 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-css-require/mod.module.css: -------------------------------------------------------------------------------- 1 | .cssModuleRequire { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-linked-include/test.css: -------------------------------------------------------------------------------- 1 | .dep-linked-include { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-not-js/foo.js: -------------------------------------------------------------------------------- 1 | export const foo = '[success] imported from .notjs file' 2 | -------------------------------------------------------------------------------- /playground/resolve/custom-condition/index.custom.js: -------------------------------------------------------------------------------- 1 | export const msg = '[success] custom condition' 2 | -------------------------------------------------------------------------------- /playground/resolve/dir-with-ext/index.js: -------------------------------------------------------------------------------- 1 | export const file = '[success] ./dir-with-ext/index.js' 2 | -------------------------------------------------------------------------------- /playground/resolve/exports-env/browser.mjs: -------------------------------------------------------------------------------- 1 | export const msg = '[success] exports env (browser.mjs)' 2 | -------------------------------------------------------------------------------- /playground/resolve/exports-legacy-fallback/dir/index.js: -------------------------------------------------------------------------------- 1 | export const msg = '[fail] mapped js file' 2 | -------------------------------------------------------------------------------- /playground/resolve/exports-path/deep.js: -------------------------------------------------------------------------------- 1 | export const msg = '[success] deep resolve from exports' 2 | -------------------------------------------------------------------------------- /playground/resolve/exports-path/main.js: -------------------------------------------------------------------------------- 1 | export const msg = '[success] entry resolve from exports' 2 | -------------------------------------------------------------------------------- /playground/tailwind/index.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /playground/tailwind/src/utils.ts: -------------------------------------------------------------------------------- 1 | export const NAME = 'Tailwind' 2 | export const INITIAL_COUNT = 1 3 | -------------------------------------------------------------------------------- /playground/wasm/heavy.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/wasm/heavy.wasm -------------------------------------------------------------------------------- /playground/worker/__tests__/iife/vite.config.js: -------------------------------------------------------------------------------- 1 | export { default } from '../../vite.config-iife' 2 | -------------------------------------------------------------------------------- /playground/worker/modules/module3.js: -------------------------------------------------------------------------------- 1 | export * from './module0' 2 | export const msg3 = 'module3' 3 | -------------------------------------------------------------------------------- /.github/pr-workflow-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/.github/pr-workflow-dark.png -------------------------------------------------------------------------------- /packages/vite/src/node/server/__tests__/fixtures/lerna/nested/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true 3 | } 4 | -------------------------------------------------------------------------------- /packages/vite/src/node/server/__tests__/fixtures/none/nested/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true 3 | } 4 | -------------------------------------------------------------------------------- /packages/vite/src/node/server/__tests__/fixtures/pnpm/nested/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true 3 | } 4 | -------------------------------------------------------------------------------- /packages/vite/src/node/server/__tests__/fixtures/yarn/nested/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true 3 | } 4 | -------------------------------------------------------------------------------- /playground/assets/__tests__/url-base/vite.config.js: -------------------------------------------------------------------------------- 1 | export { default } from '../../vite.config-url-base' 2 | -------------------------------------------------------------------------------- /playground/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/assets/favicon.ico -------------------------------------------------------------------------------- /playground/config/packages/plugin-module-condition/index.d.ts: -------------------------------------------------------------------------------- 1 | const str: string 2 | export default str 3 | -------------------------------------------------------------------------------- /playground/css-sourcemap/imported.less: -------------------------------------------------------------------------------- 1 | .imported { 2 | &-less { 3 | color: @color; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /playground/css/layered/blue.css: -------------------------------------------------------------------------------- 1 | @media screen { 2 | .layers-blue { 3 | color: blue; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /playground/dynamic-import/nested/nested/self.js: -------------------------------------------------------------------------------- 1 | export const self = 'dynamic-import-nested-self-content' 2 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/reexports.bak/source.ts: -------------------------------------------------------------------------------- 1 | export const a = 'a0' 2 | export const b = 'b0' 3 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/unused-exports/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /playground/hmr/modules.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'virtual:file' { 2 | export const virtual: string 3 | } 4 | -------------------------------------------------------------------------------- /playground/html/inline/dep3.js: -------------------------------------------------------------------------------- 1 | import './dep2' 2 | import { log } from './common' 3 | 4 | log('dep3') 5 | -------------------------------------------------------------------------------- /playground/minify/index.html: -------------------------------------------------------------------------------- 1 |

Minify

2 | 3 | 4 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-d/test-package-d-nested/index.js: -------------------------------------------------------------------------------- 1 | export default 'D-nested@1.0.0' 2 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-linked-include/Test.vue: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-linked-include/foo.js: -------------------------------------------------------------------------------- 1 | export const msg = '[success] linked force include' 2 | -------------------------------------------------------------------------------- /playground/preserve-symlinks/module-a/src/data.js: -------------------------------------------------------------------------------- 1 | export const data = { 2 | msg: 'hello vite', 3 | } 4 | -------------------------------------------------------------------------------- /playground/proxy-hmr/index.html: -------------------------------------------------------------------------------- 1 | root app
2 | 3 | -------------------------------------------------------------------------------- /playground/resolve/browser-module-field2/index.js: -------------------------------------------------------------------------------- 1 | export default '[success] this should run in browser' 2 | -------------------------------------------------------------------------------- /playground/resolve/browser-module-field3/index.js: -------------------------------------------------------------------------------- 1 | export default '[success] this should run in browser' 2 | -------------------------------------------------------------------------------- /playground/resolve/custom-main-field/index.custom.js: -------------------------------------------------------------------------------- 1 | export const msg = '[success] custom main field' 2 | -------------------------------------------------------------------------------- /playground/resolve/exports-legacy-fallback/dir/index.mjs: -------------------------------------------------------------------------------- 1 | export const msg = '[success] mapped mjs file' 2 | -------------------------------------------------------------------------------- /playground/resolve/exports-path/dir/dir.js: -------------------------------------------------------------------------------- 1 | export const msg = '[success] mapped directory from exports' 2 | -------------------------------------------------------------------------------- /playground/resolve/imports-path/slash/index.js: -------------------------------------------------------------------------------- 1 | export const msg = '[success] subpath imports with slash' 2 | -------------------------------------------------------------------------------- /playground/resolve/imports-path/star/index.js: -------------------------------------------------------------------------------- 1 | export const msg = '[success] subpath imports with star' 2 | -------------------------------------------------------------------------------- /playground/resolve/imports-path/top-level.js: -------------------------------------------------------------------------------- 1 | export const msg = '[success] top level subpath imports' 2 | -------------------------------------------------------------------------------- /playground/tsconfig-json-load-error/has-error/main.ts: -------------------------------------------------------------------------------- 1 | console.log('tsconfig error fixed, file loaded') 2 | -------------------------------------------------------------------------------- /playground/wasm/light.wasm: -------------------------------------------------------------------------------- 1 | asm``imports imported_func exported_func 2 | A* -------------------------------------------------------------------------------- /.github/issue-workflow-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/.github/issue-workflow-dark.png -------------------------------------------------------------------------------- /docs/public/ecosystem-vite4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/docs/public/ecosystem-vite4.png -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/env/.env.development: -------------------------------------------------------------------------------- 1 | VITE_ENV1=ENV1 2 | VITE_ENV2=ENV2 3 | VITE_ENV3=ENV3 4 | -------------------------------------------------------------------------------- /playground/css/async/index.js: -------------------------------------------------------------------------------- 1 | import('./async-1.js') 2 | import('./async-2.js') 3 | import('./async-3.js') 4 | -------------------------------------------------------------------------------- /playground/css/layered/green.css: -------------------------------------------------------------------------------- 1 | @media screen { 2 | .layers-green { 3 | color: green; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /playground/css/nested/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/css/nested/icon.png -------------------------------------------------------------------------------- /playground/dynamic-import/alias/hi.js: -------------------------------------------------------------------------------- 1 | export function hi() { 2 | return 'hi' 3 | } 4 | console.log('hi.js') 5 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/reexports.bak/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/star-imports/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /playground/hmr/missing-import/index.html: -------------------------------------------------------------------------------- 1 |
Page
2 | 3 | -------------------------------------------------------------------------------- /playground/html/inline/shared.js: -------------------------------------------------------------------------------- 1 | import './dep3' 2 | import { log } from './common' 3 | 4 | log('shared') 5 | -------------------------------------------------------------------------------- /playground/html/inline/unique.js: -------------------------------------------------------------------------------- 1 | import { log } from './common' 2 | import './dep2' 3 | 4 | log('unique') 5 | -------------------------------------------------------------------------------- /playground/minify/main.js: -------------------------------------------------------------------------------- 1 | import './test.css' 2 | 3 | if (window) { 4 | console.log('hello world') 5 | } 6 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-cjs-browser-field-bare/events-shim.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | foo: 'foo', 3 | } 4 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-relative-to-main/lib/main.js: -------------------------------------------------------------------------------- 1 | module.exports = '[success] imported from main' 2 | -------------------------------------------------------------------------------- /playground/resolve/browser-module-field1/index.js: -------------------------------------------------------------------------------- 1 | export default '[fail] this should not run in the browser' 2 | -------------------------------------------------------------------------------- /playground/resolve/browser-module-field1/index.web.js: -------------------------------------------------------------------------------- 1 | export default '[success] this should run in browser' 2 | -------------------------------------------------------------------------------- /playground/resolve/exports-env/browser.prod.mjs: -------------------------------------------------------------------------------- 1 | export const msg = '[success] exports env (browser.prod.mjs)' 2 | -------------------------------------------------------------------------------- /playground/resolve/exports-from-root/file.js: -------------------------------------------------------------------------------- 1 | export const msg = '[success] exports from root (./file.js)' 2 | -------------------------------------------------------------------------------- /playground/resolve/imports-path/nested-path.js: -------------------------------------------------------------------------------- 1 | export const msg = '[success] nested path subpath imports' 2 | -------------------------------------------------------------------------------- /playground/ssr-deps/no-external-cjs/index.js: -------------------------------------------------------------------------------- 1 | exports.hello = function () { 2 | return 'Hello World!' 3 | } 4 | -------------------------------------------------------------------------------- /playground/ssr-noexternal/require-external-cjs/main.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@vitejs/test-external-cjs') 2 | -------------------------------------------------------------------------------- /playground/ssr-resolve/entries/file.js: -------------------------------------------------------------------------------- 1 | module.exports = __filename.slice(__filename.lastIndexOf('entries')) 2 | -------------------------------------------------------------------------------- /playground/tailwind-sourcemap/tailwind.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /playground/worker/modules/test-plugin.js: -------------------------------------------------------------------------------- 1 | export const bundleWithPlugin = 'worker bundle with plugin fail. ' 2 | -------------------------------------------------------------------------------- /docs/public/logo-with-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/docs/public/logo-with-shadow.png -------------------------------------------------------------------------------- /docs/public/vite4-3-hmr-time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/docs/public/vite4-3-hmr-time.png -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/plugins/importGlob/fixture-a/sibling.ts: -------------------------------------------------------------------------------- 1 | export const name = 'I am your sibling!' 2 | -------------------------------------------------------------------------------- /playground/assets/__tests__/relative-base/vite.config.js: -------------------------------------------------------------------------------- 1 | export { default } from '../../vite.config-relative-base' 2 | -------------------------------------------------------------------------------- /playground/assets/__tests__/runtime-base/vite.config.js: -------------------------------------------------------------------------------- 1 | export { default } from '../../vite.config-runtime-base' 2 | -------------------------------------------------------------------------------- /playground/assets/nested/asset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/assets/nested/asset.png -------------------------------------------------------------------------------- /playground/assets/nested/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/assets/nested/icon.png -------------------------------------------------------------------------------- /playground/assets/static/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/assets/static/icon.png -------------------------------------------------------------------------------- /playground/css-codesplit-cjs/index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | -------------------------------------------------------------------------------- /playground/css-lightningcss/inlined.css: -------------------------------------------------------------------------------- 1 | .inlined { 2 | color: green; 3 | background: url('./ok.png'); 4 | } 5 | -------------------------------------------------------------------------------- /playground/css-lightningcss/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/css-lightningcss/ok.png -------------------------------------------------------------------------------- /playground/external/src/main.js: -------------------------------------------------------------------------------- 1 | import '@vitejs/test-dep-that-imports' 2 | import '@vitejs/test-dep-that-requires' 3 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/main-accepted/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /playground/hmr/counter/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /playground/html/inline/shared-1.html: -------------------------------------------------------------------------------- 1 |

2 | 
3 | 


--------------------------------------------------------------------------------
/playground/html/inline/shared-2.html:
--------------------------------------------------------------------------------
1 | 

2 | 
3 | 


--------------------------------------------------------------------------------
/playground/html/inline/unique.html:
--------------------------------------------------------------------------------
1 | 

2 | 
3 | 


--------------------------------------------------------------------------------
/playground/nested-deps/test-package-c/index.js:
--------------------------------------------------------------------------------
1 | // this module should not be resolved
2 | export default 'C@1.0.0'
3 | 


--------------------------------------------------------------------------------
/playground/preload/__tests__/resolve-deps/vite.config.js:
--------------------------------------------------------------------------------
1 | export { default } from '../../vite.config-resolve-deps'
2 | 


--------------------------------------------------------------------------------
/playground/resolve/browser-module-field2/index.web.js:
--------------------------------------------------------------------------------
1 | module.exports = '[fail] this should not run in the browser'
2 | 


--------------------------------------------------------------------------------
/playground/resolve/exports-from-root/nested/file.js:
--------------------------------------------------------------------------------
1 | export const msg = 'fail exports from root (./nested/file.js)'
2 | 


--------------------------------------------------------------------------------
/playground/resolve/sharp-dir/index.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 |   last: require('es5-ext/string/#/last.js'),
3 | }
4 | 


--------------------------------------------------------------------------------
/playground/resolve/ts-extension/hello.ts:
--------------------------------------------------------------------------------
1 | export const msg = '[success] use .js extension to import a ts module'
2 | 


--------------------------------------------------------------------------------
/playground/resolve/util/index.js:
--------------------------------------------------------------------------------
1 | export function foo() {
2 |   return '[success] resolve omitted /index.*'
3 | }
4 | 


--------------------------------------------------------------------------------
/playground/ssr-resolve/entries/dir/index.js:
--------------------------------------------------------------------------------
1 | module.exports = __filename.slice(__filename.lastIndexOf('entries'))
2 | 


--------------------------------------------------------------------------------
/playground/wasm/add.wasm:
--------------------------------------------------------------------------------
1 | asm`addadd2add3add4
2 | !  j  j  j  j


--------------------------------------------------------------------------------
/playground/worker/__tests__/relative-base/vite.config.js:
--------------------------------------------------------------------------------
1 | export { default } from '../../vite.config-relative-base'
2 | 


--------------------------------------------------------------------------------
/playground/worker/modules/workerImport.ts:
--------------------------------------------------------------------------------
1 | export const msg = 'pong'
2 | export const mode = process.env.NODE_ENV
3 | 


--------------------------------------------------------------------------------
/docs/images/vercel-configuration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BuilderIO/vite/main/docs/images/vercel-configuration.png


--------------------------------------------------------------------------------
/docs/images/vite-plugin-inspect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BuilderIO/vite/main/docs/images/vite-plugin-inspect.png


--------------------------------------------------------------------------------
/docs/public/vite4-3-startup-time.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BuilderIO/vite/main/docs/public/vite4-3-startup-time.png


--------------------------------------------------------------------------------
/packages/create-vite/template-svelte/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 |   "recommendations": ["svelte.svelte-vscode"]
3 | }
4 | 


--------------------------------------------------------------------------------
/packages/vite/src/node/__tests__/plugins/dynamicImportVar/mods/hi.js:
--------------------------------------------------------------------------------
1 | export function hi() {
2 |   return 'hi'
3 | }
4 | 


--------------------------------------------------------------------------------
/playground/assets/static/import-expression.js:
--------------------------------------------------------------------------------
1 | document.querySelector('.import-expression').textContent += '[success]'
2 | 


--------------------------------------------------------------------------------
/playground/dynamic-import/css/index.css:
--------------------------------------------------------------------------------
1 | .css {
2 |   box-sizing: border-box;
3 | }
4 | .view {
5 |   color: red;
6 | }
7 | 


--------------------------------------------------------------------------------
/playground/hmr/accept-exports/main-non-accepted/index.html:
--------------------------------------------------------------------------------
1 | 
2 | 


--------------------------------------------------------------------------------
/playground/js-sourcemap/dynamic/dynamic-foo.js:
--------------------------------------------------------------------------------
1 | import './dynamic-foo.css'
2 | 
3 | console.log('dynamic/dynamic-foo')
4 | 


--------------------------------------------------------------------------------
/playground/json/json-module/package.json:
--------------------------------------------------------------------------------
1 | {
2 |   "name": "@vitejs/test-json-module",
3 |   "version": "0.0.0"
4 | }
5 | 


--------------------------------------------------------------------------------
/playground/legacy/nested/index.html:
--------------------------------------------------------------------------------
1 | 

2 | 3 | -------------------------------------------------------------------------------- /playground/object-hooks/main.ts: -------------------------------------------------------------------------------- 1 | const app = document.getElementById('transform') 2 | app.innerText = '__TRANSFORM__' 3 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-css-require/mod.cjs: -------------------------------------------------------------------------------- 1 | const style = require('./mod.module.css') 2 | module.exports = style 3 | -------------------------------------------------------------------------------- /playground/resolve/exports-from-root/nested/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "exports": { 3 | ".": "./file.js" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /playground/resolve/ts-extension/hellotsx.tsx: -------------------------------------------------------------------------------- 1 | export const msgTsx = '[success] use .js extension to import a tsx module' 2 | -------------------------------------------------------------------------------- /docs/images/v3-open-issues-and-PRs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/docs/images/v3-open-issues-and-PRs.png -------------------------------------------------------------------------------- /packages/create-vite/template-svelte-ts/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["svelte.svelte-vscode"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/plugins/dynamicImportVar/mods/hello.js: -------------------------------------------------------------------------------- 1 | export function hello() { 2 | return 'hello' 3 | } 4 | -------------------------------------------------------------------------------- /packages/vite/src/types/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "//": "this file is just here to make pnpm happy with --frozen-lockfile" 3 | } 4 | -------------------------------------------------------------------------------- /playground/assets/static/raw.js: -------------------------------------------------------------------------------- 1 | document.querySelector('.raw-js').textContent = 2 | '[success] Raw js from /public loaded' 3 | -------------------------------------------------------------------------------- /playground/cli/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
vite cli works!
4 | -------------------------------------------------------------------------------- /playground/css-sourcemap/input-map.css: -------------------------------------------------------------------------------- 1 | .input-map { 2 | color: #00f; 3 | } 4 | /*# sourceMappingURL=input-map.css.map */ 5 | -------------------------------------------------------------------------------- /playground/css/folder with space/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/css/folder with space/ok.png -------------------------------------------------------------------------------- /playground/dynamic-import/alias/hello.js: -------------------------------------------------------------------------------- 1 | export function hello() { 2 | return 'hello' 3 | } 4 | console.log('hello.js') 5 | -------------------------------------------------------------------------------- /playground/html/main.js: -------------------------------------------------------------------------------- 1 | import { msg } from './shared' 2 | import './common.css' 3 | 4 | console.log(msg + ' from main') 5 | -------------------------------------------------------------------------------- /playground/html/valid.js: -------------------------------------------------------------------------------- 1 | document.getElementById( 2 | `no-quotes-on-attr`, 3 | ).innerHTML = `No quotes on Attr working` 4 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-node-env/index.js: -------------------------------------------------------------------------------- 1 | export const env = process.env.NODE_ENV === 'production' ? 'prod' : 'dev' 2 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-with-dynamic-import/dynamic.js: -------------------------------------------------------------------------------- 1 | export const foo = '[success] dependency with dynamic import' 2 | -------------------------------------------------------------------------------- /playground/preload/__tests__/preload-disabled/vite.config.js: -------------------------------------------------------------------------------- 1 | export { default } from '../../vite.config-preload-disabled' 2 | -------------------------------------------------------------------------------- /playground/resolve/exports-and-nested-scope/nested-scope/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "type": "module" 4 | } 5 | -------------------------------------------------------------------------------- /playground/resolve/exports-legacy-fallback/dir/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "index.js", 3 | "module": "index.mjs" 4 | } 5 | -------------------------------------------------------------------------------- /playground/resolve/imports-path/other-pkg/nest/index.js: -------------------------------------------------------------------------------- 1 | export const msg = '[success] subpath imports from other package' 2 | -------------------------------------------------------------------------------- /playground/resolve/ts-extension/hellojsx.tsx: -------------------------------------------------------------------------------- 1 | export const msgJsx = '[success] use .jsx extension to import a tsx module' 2 | -------------------------------------------------------------------------------- /playground/resolve/ts-extension/hellomjs.mts: -------------------------------------------------------------------------------- 1 | export const msgMjs = '[success] use .mjs extension to import an ESM module' 2 | -------------------------------------------------------------------------------- /playground/tailwind/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/tailwind/public/favicon.ico -------------------------------------------------------------------------------- /playground/tailwind/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/tailwind/src/assets/logo.png -------------------------------------------------------------------------------- /playground/tailwind/src/components/PugTemplate.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /playground/tsconfig-json/src/not-used-type.ts: -------------------------------------------------------------------------------- 1 | console.log('main side effect') 2 | 3 | export class MainTypeOnlyClass {} 4 | -------------------------------------------------------------------------------- /playground/worker/__tests__/relative-base-iife/vite.config.js: -------------------------------------------------------------------------------- 1 | export { default } from '../../vite.config-relative-base-iife' 2 | -------------------------------------------------------------------------------- /docs/public/og-image-announcing-vite3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/docs/public/og-image-announcing-vite3.png -------------------------------------------------------------------------------- /docs/public/og-image-announcing-vite4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/docs/public/og-image-announcing-vite4.png -------------------------------------------------------------------------------- /packages/create-vite/template-svelte/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /packages/vite/types/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "//": "this file is here to make typescript happy when moduleResolution=node16+" 3 | } 4 | -------------------------------------------------------------------------------- /playground/assets/fonts/Inter-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/assets/fonts/Inter-Italic.woff -------------------------------------------------------------------------------- /playground/dynamic-import/nested/deps.js: -------------------------------------------------------------------------------- 1 | /* don't include dynamic import inside this file */ 2 | 3 | import '@vitejs/test-pkg' 4 | -------------------------------------------------------------------------------- /playground/html/side-effects/index.html: -------------------------------------------------------------------------------- 1 |

sideEffects false

2 | 3 | -------------------------------------------------------------------------------- /playground/js-sourcemap/after-preload-dynamic.js: -------------------------------------------------------------------------------- 1 | import('./dynamic/dynamic-foo') 2 | 3 | console.log('after preload dynamic') 4 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-b/index.js: -------------------------------------------------------------------------------- 1 | export { default as A } from 'test-package-a' 2 | 3 | export default 'B@1.0.0' 4 | -------------------------------------------------------------------------------- /playground/resolve/exports-with-module-condition/index.mjs: -------------------------------------------------------------------------------- 1 | export const msg = '[fail] exports with module condition (index.mjs)' 2 | -------------------------------------------------------------------------------- /playground/resolve/ts-extension/hellocjs.cts: -------------------------------------------------------------------------------- 1 | export const msgCjs = '[success] use .cjs extension to import a CommonJS module' 2 | -------------------------------------------------------------------------------- /playground/resolve/utf8-bom/main.js: -------------------------------------------------------------------------------- 1 | import '@babel/runtime/helpers/esm/slicedToArray' 2 | 3 | export const msg = '[success]' 4 | -------------------------------------------------------------------------------- /playground/ssr-deps/forwarded-export/index.js: -------------------------------------------------------------------------------- 1 | const original = require('object-assigned-exports') 2 | module.exports = original 3 | -------------------------------------------------------------------------------- /playground/ssr/src/circular-dep-init/circular-dep-init.js: -------------------------------------------------------------------------------- 1 | export * from './module-a' 2 | export { getValueAB } from './module-b' 3 | -------------------------------------------------------------------------------- /playground/transform-plugin/index.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | -------------------------------------------------------------------------------- /playground/tsconfig-json/nested/not-used-type.ts: -------------------------------------------------------------------------------- 1 | console.log('nested side effect') 2 | 3 | export class NestedTypeOnlyClass {} 4 | -------------------------------------------------------------------------------- /playground/worker/modules/module2.js: -------------------------------------------------------------------------------- 1 | export * from './module0' 2 | export * from './module1' 3 | export const msg2 = 'module2' 4 | -------------------------------------------------------------------------------- /docs/images/v3-new-open-issues-and-PRs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/docs/images/v3-new-open-issues-and-PRs.png -------------------------------------------------------------------------------- /docs/public/og-image-announcing-vite4-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/docs/public/og-image-announcing-vite4-3.png -------------------------------------------------------------------------------- /packages/create-vite/template-svelte-ts/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /playground/alias/dir/from-script-src.js: -------------------------------------------------------------------------------- 1 | document.querySelector('.from-script-src').textContent = 2 | '[success] from script src' 3 | -------------------------------------------------------------------------------- /playground/assets/fonts/Inter-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/assets/fonts/Inter-Italic.woff2 -------------------------------------------------------------------------------- /playground/css-sourcemap/linked-with-import.css: -------------------------------------------------------------------------------- 1 | @import '@/be-imported.css'; 2 | 3 | .linked-with-import { 4 | color: red; 5 | } 6 | -------------------------------------------------------------------------------- /playground/css/__tests__/no-css-minify/vite.config.js: -------------------------------------------------------------------------------- 1 | import config from '../../vite.config-no-css-minify' 2 | export default config 3 | -------------------------------------------------------------------------------- /playground/css/__tests__/same-file-name/vite.config.js: -------------------------------------------------------------------------------- 1 | import config from '../../vite.config-same-file-name' 2 | export default config 3 | -------------------------------------------------------------------------------- /playground/css/async/async-1.js: -------------------------------------------------------------------------------- 1 | import { createButton } from './base' 2 | import './async-1.css' 3 | 4 | createButton('async-blue') 5 | -------------------------------------------------------------------------------- /playground/css/async/async-2.js: -------------------------------------------------------------------------------- 1 | import { createButton } from './base' 2 | import './async-2.css' 3 | 4 | createButton('async-green') 5 | -------------------------------------------------------------------------------- /playground/css/options/absolute-import.styl: -------------------------------------------------------------------------------- 1 | .stylus-options-absolute-import 2 | /* imported via vite.config.js */ 3 | color red 4 | -------------------------------------------------------------------------------- /playground/css/options/relative-import.styl: -------------------------------------------------------------------------------- 1 | .stylus-options-relative-import 2 | /* imported via vite.config.js */ 3 | color green 4 | -------------------------------------------------------------------------------- /playground/hmr/counter/dep.ts: -------------------------------------------------------------------------------- 1 | // This file is never loaded 2 | if (import.meta.hot) { 3 | import.meta.hot.accept(() => {}) 4 | } 5 | -------------------------------------------------------------------------------- /playground/html/nested/nested.js: -------------------------------------------------------------------------------- 1 | import { msg } from '../shared' 2 | import '../common.css' 3 | 4 | console.log(msg + ' from nested') 5 | -------------------------------------------------------------------------------- /playground/legacy/worker.js: -------------------------------------------------------------------------------- 1 | import { module } from './module' 2 | 3 | self.onmessage = () => { 4 | self.postMessage(module) 5 | } 6 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-not-js/index.notjs: -------------------------------------------------------------------------------- 1 | 2 | import { foo } from './foo' 3 | export const notjsValue = foo 4 | 5 | -------------------------------------------------------------------------------- /playground/optimize-missing-deps/main.js: -------------------------------------------------------------------------------- 1 | import { sayName } from '@vitejs/test-missing-dep' 2 | 3 | export const name = sayName() 4 | -------------------------------------------------------------------------------- /playground/resolve/browser-field/no-ext.js: -------------------------------------------------------------------------------- 1 | import jsdom from 'jsdom' // should be redirected to empty module 2 | export default '' 3 | -------------------------------------------------------------------------------- /playground/resolve/browser-field/not-browser.js: -------------------------------------------------------------------------------- 1 | const fs = require('node:fs') 2 | console.log('this should not run in the browser') 3 | -------------------------------------------------------------------------------- /playground/resolve/imports-path/other-pkg/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-resolve-imports-pkg", 3 | "private": true 4 | } 5 | -------------------------------------------------------------------------------- /scripts/publishCI.ts: -------------------------------------------------------------------------------- 1 | import { publish } from '@vitejs/release-scripts' 2 | 3 | publish({ defaultPackage: 'vite', provenance: true }) 4 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/env/.env: -------------------------------------------------------------------------------- 1 | VITE_APP_BASE_ROUTE=/ 2 | VITE_APP_BASE_URL=$VITE_APP_BASE_ROUTE 3 | 4 | VVITE_A=A 5 | VVITE_B=B 6 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/plugins/importGlob/fixture-b/index.ts: -------------------------------------------------------------------------------- 1 | export { name as a } from './a' 2 | export { name as b } from './b' 3 | -------------------------------------------------------------------------------- /playground/css-sourcemap/imported-with-import.css: -------------------------------------------------------------------------------- 1 | @import '@/be-imported.css'; 2 | 3 | .imported-with-import { 4 | color: red; 5 | } 6 | -------------------------------------------------------------------------------- /playground/css/pkg-dep/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dep", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /playground/dynamic-import/alias/worker.js: -------------------------------------------------------------------------------- 1 | self.onmessage = (event) => { 2 | self.postMessage({ 3 | msg: 'load worker', 4 | }) 5 | } 6 | -------------------------------------------------------------------------------- /playground/preserve-symlinks/module-a/src/index.js: -------------------------------------------------------------------------------- 1 | import { data } from './data' 2 | 3 | export function sayHi() { 4 | return data 5 | } 6 | -------------------------------------------------------------------------------- /playground/resolve/browser-field/multiple.dot.path.js: -------------------------------------------------------------------------------- 1 | const fs = require('node:fs') 2 | console.log('this should not run in the browser') 3 | -------------------------------------------------------------------------------- /playground/resolve/exports-with-module-condition/index.esm.js: -------------------------------------------------------------------------------- 1 | export const msg = '[success] exports with module condition (index.esm.js)' 2 | -------------------------------------------------------------------------------- /playground/resolve/util/bar.util.js: -------------------------------------------------------------------------------- 1 | export function bar() { 2 | return '[success] resolve filename containing dot and omitting ext' 3 | } 4 | -------------------------------------------------------------------------------- /playground/ssr-resolve/entries/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-entries", 3 | "private": true, 4 | "version": "0.0.0" 5 | } 6 | -------------------------------------------------------------------------------- /playground/worker/__tests__/sourcemap/vite.config.js: -------------------------------------------------------------------------------- 1 | import sourcemap from '../../vite.config-sourcemap' 2 | export default sourcemap(true) 3 | -------------------------------------------------------------------------------- /packages/create-vite/template-vue-ts/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/create-vite/template-vue/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/packages/build-project/index.html: -------------------------------------------------------------------------------- 1 |

Hello world

2 | 3 | 4 | -------------------------------------------------------------------------------- /packages/vite/src/node/server/__tests__/fixtures/yarn/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "workspaces": [ 4 | "nested" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /playground/assets/nested/テスト-測試-white space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/assets/nested/テスト-測試-white space.png -------------------------------------------------------------------------------- /playground/backend-integration/frontend/entrypoints/nested/blue.scss: -------------------------------------------------------------------------------- 1 | $primary: #cc0000; 2 | 3 | .text-primary { 4 | color: $primary; 5 | } 6 | -------------------------------------------------------------------------------- /playground/css/css-js-dep/index.js: -------------------------------------------------------------------------------- 1 | import './foo.css' 2 | import barModuleClasses from './bar.module.css' 3 | 4 | export { barModuleClasses } 5 | -------------------------------------------------------------------------------- /playground/css/dep.css: -------------------------------------------------------------------------------- 1 | @import '@vitejs/test-css-dep'; 2 | @import '@vitejs/test-css-dep-exports'; 3 | @import '@vitejs/test-css-proxy-dep'; 4 | -------------------------------------------------------------------------------- /playground/dynamic-import/views/baz.js: -------------------------------------------------------------------------------- 1 | import { n } from '../nested/shared' 2 | console.log('baz' + n) 3 | 4 | export const msg = 'Baz view' 5 | -------------------------------------------------------------------------------- /playground/dynamic-import/views/foo.js: -------------------------------------------------------------------------------- 1 | import { n } from '../nested/shared' 2 | console.log('foo' + n) 3 | 4 | export const msg = 'Foo view' 5 | -------------------------------------------------------------------------------- /playground/env-nested/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | 3 | export default defineConfig({ 4 | envDir: './envs', 5 | }) 6 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/export-from/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/side-effects/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/unused-exports/index.ts: -------------------------------------------------------------------------------- 1 | import './unused' 2 | import { foo } from './used' 3 | 4 | console.log('used:' + foo) 5 | -------------------------------------------------------------------------------- /playground/multiple-entrypoints/reference.js: -------------------------------------------------------------------------------- 1 | import './reference.scss' 2 | 3 | document.querySelector('.content').textContent = 'Reference' 4 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-cjs-compiled-from-cjs/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | function foo() { 3 | return 'foo' 4 | } 5 | module.exports = foo 6 | -------------------------------------------------------------------------------- /playground/optimize-missing-deps/multi-entry-dep/index.js: -------------------------------------------------------------------------------- 1 | const path = require('node:path') 2 | 3 | exports.name = path.normalize('./Server') 4 | -------------------------------------------------------------------------------- /playground/preload/dep-including-a/index.js: -------------------------------------------------------------------------------- 1 | export { msgFromA } from '@vitejs/test-dep-a' 2 | 3 | export const msg = 'From dep-including-a' 4 | -------------------------------------------------------------------------------- /playground/resolve/browser-field/no-ext-index/index.js: -------------------------------------------------------------------------------- 1 | import jsdom from 'jsdom' // should be redirected to empty module 2 | export default '' 3 | -------------------------------------------------------------------------------- /playground/ssr-deps/only-object-assigned-exports/index.js: -------------------------------------------------------------------------------- 1 | Object.assign(exports, { 2 | hello() { 3 | return 'Hello World!' 4 | }, 5 | }) 6 | -------------------------------------------------------------------------------- /playground/assets/asset/main.js: -------------------------------------------------------------------------------- 1 | function text(el, text) { 2 | document.querySelector(el).textContent = text 3 | } 4 | text('.relative-js', 'hello') 5 | -------------------------------------------------------------------------------- /playground/config/packages/siblings/foo.ts: -------------------------------------------------------------------------------- 1 | import lodash from 'lodash' 2 | 3 | export const array = lodash.partition([1, 2, 3, 4], (n) => n % 2) 4 | -------------------------------------------------------------------------------- /playground/css-lightningcss/composes-path-resolving.module.css: -------------------------------------------------------------------------------- 1 | .path-resolving-css { 2 | composes: apply-color from './composed.module.css'; 3 | } 4 | -------------------------------------------------------------------------------- /playground/css/nested/css-in-less.less: -------------------------------------------------------------------------------- 1 | @import url('./css-in-less.css'); 2 | @import './css-in-less.css'; 3 | 4 | @import './css-in-less-2.less'; 5 | -------------------------------------------------------------------------------- /playground/env/index.js: -------------------------------------------------------------------------------- 1 | text('.url', import.meta.url) 2 | 3 | function text(el, text) { 4 | document.querySelector(el).textContent = text 5 | } 6 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/dynamic-imports/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-d/index.js: -------------------------------------------------------------------------------- 1 | export { default as nestedD } from '@vitejs/test-package-d-nested' 2 | 3 | export default 'D@1.0.0' 4 | -------------------------------------------------------------------------------- /playground/optimize-deps/added-in-entries/index.js: -------------------------------------------------------------------------------- 1 | // written in cjs, optimization should convert this to esm 2 | module.exports = 'added-in-entries' 3 | -------------------------------------------------------------------------------- /playground/optimize-deps/nested-include/index.js: -------------------------------------------------------------------------------- 1 | // written in cjs, optimization should convert this to esm 2 | module.exports = 'nested-include' 3 | -------------------------------------------------------------------------------- /playground/preload/src/about.js: -------------------------------------------------------------------------------- 1 | import { msg } from '@vitejs/test-dep-including-a' 2 | 3 | document.querySelector('#about .msg').textContent = msg 4 | -------------------------------------------------------------------------------- /playground/resolve/browser-field/bare-import.js: -------------------------------------------------------------------------------- 1 | import message from '@vitejs/test-resolve-browser-field-bare-import-fail' 2 | export default message 3 | -------------------------------------------------------------------------------- /playground/ssr/src/circular-dep-init/README.md: -------------------------------------------------------------------------------- 1 | This test aim to find out wherever the modules with circular dependencies are correctly initialized 2 | -------------------------------------------------------------------------------- /packages/vite/src/node/ssr/__tests__/fixtures/modules/has-invalid-import.js: -------------------------------------------------------------------------------- 1 | import { foo } from './non-existent.js' 2 | 3 | export const hello = 'world' 4 | -------------------------------------------------------------------------------- /playground/css-dynamic-import/index.html: -------------------------------------------------------------------------------- 1 |

This should be green

2 | 3 | 4 | -------------------------------------------------------------------------------- /playground/html/nested/asset/main.js: -------------------------------------------------------------------------------- 1 | function text(el, text) { 2 | document.querySelector(el).textContent = text 3 | } 4 | text('.relative-js', 'hello') 5 | -------------------------------------------------------------------------------- /playground/import-assertion/import-assertion-dep/index.js: -------------------------------------------------------------------------------- 1 | import json from './data.json' assert { type: 'json' } 2 | 3 | export const hello = json.hello 4 | -------------------------------------------------------------------------------- /playground/object-hooks/index.html: -------------------------------------------------------------------------------- 1 |

Transform Hook order

2 |
3 | 4 | 5 | -------------------------------------------------------------------------------- /playground/preserve-symlinks/src/main.js: -------------------------------------------------------------------------------- 1 | import { sayHi } from '@vitejs/test-module-a' 2 | 3 | document.getElementById('root').innerText = sayHi().msg 4 | -------------------------------------------------------------------------------- /playground/resolve/exports-with-module/import.mjs: -------------------------------------------------------------------------------- 1 | // import.mjs should take precedence 2 | export const msg = '[success] exports with module (import.mjs)' 3 | -------------------------------------------------------------------------------- /playground/resolve/exports-with-module/module.mjs: -------------------------------------------------------------------------------- 1 | // import.mjs should take precedence 2 | export const msg = '[fail] exports with module (module.mjs)' 3 | -------------------------------------------------------------------------------- /playground/ssr-deps/primitive-export/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-primitive-export", 3 | "private": true, 4 | "version": "0.0.0" 5 | } 6 | -------------------------------------------------------------------------------- /playground/ssr-deps/read-file-content/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-read-file-content", 3 | "private": true, 4 | "version": "0.0.0" 5 | } 6 | -------------------------------------------------------------------------------- /playground/ssr-deps/require-absolute/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-require-absolute", 3 | "private": true, 4 | "version": "0.0.0" 5 | } 6 | -------------------------------------------------------------------------------- /playground/ssr-deps/src/isomorphic-module-browser.js: -------------------------------------------------------------------------------- 1 | const message = 'message from isomorphic-module (browser): [browser]' 2 | 3 | export default message 4 | -------------------------------------------------------------------------------- /playground/ssr-deps/src/isomorphic-module-server.js: -------------------------------------------------------------------------------- 1 | const message = 'message from isomorphic-module (server): [server]' 2 | 3 | export default message 4 | -------------------------------------------------------------------------------- /playground/ssr/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | 3 | // in order to trigger ssr server restart 4 | export default defineConfig({}) 5 | -------------------------------------------------------------------------------- /playground/worker/__tests__/sourcemap-hidden/vite.config.js: -------------------------------------------------------------------------------- 1 | import sourcemap from '../../vite.config-sourcemap' 2 | export default sourcemap('hidden') 3 | -------------------------------------------------------------------------------- /playground/worker/__tests__/sourcemap-inline/vite.config.js: -------------------------------------------------------------------------------- 1 | import sourcemap from '../../vite.config-sourcemap' 2 | export default sourcemap('inline') 3 | -------------------------------------------------------------------------------- /playground/backend-integration/frontend/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BuilderIO/vite/main/playground/backend-integration/frontend/images/logo.png -------------------------------------------------------------------------------- /playground/cli-module/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
vite cli in "type":"module" package works!
4 | -------------------------------------------------------------------------------- /playground/lib/src/dynamic.css: -------------------------------------------------------------------------------- 1 | @import 'https://cdn.jsdelivr.net/npm/@mdi/font@5.9.55/css/materialdesignicons.min.css'; 2 | .dynamic { 3 | color: red; 4 | } 5 | -------------------------------------------------------------------------------- /playground/optimize-deps-no-discovery/dep-no-discovery/index.js: -------------------------------------------------------------------------------- 1 | // written in cjs, optimization should convert this to esm 2 | module.exports = '[success]' 3 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-cjs-browser-field-bare/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const internal = require('./internal') 4 | 5 | module.exports = internal 6 | -------------------------------------------------------------------------------- /playground/resolve-linked/src/index.js: -------------------------------------------------------------------------------- 1 | import { msg as depMsg } from '../dep' 2 | 3 | export const msg = `[success] out of root monorepo dep with ${depMsg}` 4 | -------------------------------------------------------------------------------- /playground/ssr-deps/define-property-exports/index.js: -------------------------------------------------------------------------------- 1 | Object.defineProperty(exports, 'hello', { 2 | value() { 3 | return 'Hello World!' 4 | }, 5 | }) 6 | -------------------------------------------------------------------------------- /playground/wasm/worker.js: -------------------------------------------------------------------------------- 1 | import init from './add.wasm?init' 2 | init().then(({ exports }) => { 3 | self.postMessage({ result: exports.add(1, 2) }) 4 | }) 5 | -------------------------------------------------------------------------------- /playground/css/linked.css: -------------------------------------------------------------------------------- 1 | @import '=/linked-at-import.css'; 2 | 3 | /* test postcss nesting */ 4 | .wrapper { 5 | .linked { 6 | color: blue; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /playground/glob-import/dir/nested/bar.js: -------------------------------------------------------------------------------- 1 | const modules = import.meta.glob('../*.json', { eager: true }) 2 | 3 | export const msg = 'bar' 4 | export { modules } 5 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-esbuild-plugin-transform/index.js: -------------------------------------------------------------------------------- 1 | // will be replaced by an esbuild plugin 2 | 3 | export const hello = () => `Hello from a package` 4 | -------------------------------------------------------------------------------- /playground/optimize-deps/nested-exclude/index.js: -------------------------------------------------------------------------------- 1 | export { default as nestedInclude } from '@vitejs/test-nested-include' 2 | 3 | export default 'nested-exclude' 4 | -------------------------------------------------------------------------------- /playground/ssr-deps/css-lib/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-css-lib", 3 | "private": true, 4 | "version": "0.0.0", 5 | "main": "./index.css" 6 | } 7 | -------------------------------------------------------------------------------- /playground/ssr-deps/import-builtin-cjs/index.js: -------------------------------------------------------------------------------- 1 | exports.stream = require('node:stream') 2 | 3 | exports.hello = function () { 4 | return 'Hello World!' 5 | } 6 | -------------------------------------------------------------------------------- /playground/ssr-deps/ts-transpiled-exports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-ts-transpiled-exports", 3 | "private": true, 4 | "version": "0.0.0" 5 | } 6 | -------------------------------------------------------------------------------- /playground/ssr-pug/src/app.js: -------------------------------------------------------------------------------- 1 | const p = document.createElement('p') 2 | p.innerHTML = '✅ Dynamically injected script from file' 3 | document.body.appendChild(p) 4 | -------------------------------------------------------------------------------- /playground/ssr-resolve/deep-import/foo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "0.0.0", 4 | "type": "module", 5 | "module": "./index.js" 6 | } 7 | -------------------------------------------------------------------------------- /playground/ssr-resolve/deep-import/index.js: -------------------------------------------------------------------------------- 1 | export { default as foo } from './foo' 2 | export { default as bar } from './bar' 3 | export default 'external-nested' 4 | -------------------------------------------------------------------------------- /playground/tsconfig-json/nested-with-extends/not-used-type.ts: -------------------------------------------------------------------------------- 1 | console.log('nested-with-extends side effect') 2 | 3 | export class NestedWithExtendsTypeOnlyClass {} 4 | -------------------------------------------------------------------------------- /playground/alias/dir/module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-aliased-module", 3 | "private": true, 4 | "type": "module", 5 | "version": "0.0.0" 6 | } 7 | -------------------------------------------------------------------------------- /playground/assets/css/nested/at-imported-css-url.css: -------------------------------------------------------------------------------- 1 | .css-url-relative-at-imported { 2 | background: url(../../nested/asset.png); 3 | background-size: 10px; 4 | } 5 | -------------------------------------------------------------------------------- /playground/css-lightningcss/linked.css: -------------------------------------------------------------------------------- 1 | @import './linked-at-import.css'; 2 | 3 | /* test nesting */ 4 | .wrapper { 5 | .linked { 6 | color: blue; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /playground/css/folder with space/space.css: -------------------------------------------------------------------------------- 1 | .import-with-space { 2 | color: green; 3 | background: url(spacefolder/ok.png); 4 | background-position: center; 5 | } 6 | -------------------------------------------------------------------------------- /playground/define/commonjs-dep/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-commonjs-dep", 3 | "private": true, 4 | "version": "1.0.0", 5 | "type": "commonjs" 6 | } 7 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/reexports.bak/reexports.ts: -------------------------------------------------------------------------------- 1 | import { a } from './accept-named' 2 | 3 | console.log('accept-named:' + a) 4 | 5 | console.log('>>> ready') 6 | -------------------------------------------------------------------------------- /playground/minify/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | 3 | export default defineConfig({ 4 | esbuild: { 5 | minifySyntax: false, 6 | }, 7 | }) 8 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-b/node_modules/test-package-a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-package-a", 3 | "version": "1.0.0", 4 | "main": "index.js" 5 | } 6 | -------------------------------------------------------------------------------- /playground/optimize-missing-deps/missing-dep/index.js: -------------------------------------------------------------------------------- 1 | import { name } from '@vitejs/test-multi-entry-dep' 2 | 3 | export function sayName() { 4 | return name 5 | } 6 | -------------------------------------------------------------------------------- /playground/ssr-deps/define-property-exports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-define-property-exports", 3 | "private": true, 4 | "version": "0.0.0" 5 | } 6 | -------------------------------------------------------------------------------- /playground/ssr-deps/object-assigned-exports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-object-assigned-exports", 3 | "private": true, 4 | "version": "0.0.0" 5 | } 6 | -------------------------------------------------------------------------------- /playground/ssr-deps/optimized-cjs-with-nested-external/index.js: -------------------------------------------------------------------------------- 1 | const getMessage = require('nested-external') 2 | 3 | module.exports = { 4 | hello: getMessage, 5 | } 6 | -------------------------------------------------------------------------------- /playground/ssr-deps/optimized-with-nested-external/index.js: -------------------------------------------------------------------------------- 1 | import getMessage from 'nested-external' 2 | 3 | export function hello() { 4 | return getMessage() 5 | } 6 | -------------------------------------------------------------------------------- /playground/ssr-deps/require-absolute/index.js: -------------------------------------------------------------------------------- 1 | const path = require('node:path') 2 | 3 | module.exports.hello = () => require(path.resolve(__dirname, './foo.js')).hello 4 | -------------------------------------------------------------------------------- /playground/ssr-resolve/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | 3 | export default defineConfig({ 4 | build: { 5 | ssr: './main.js', 6 | }, 7 | }) 8 | -------------------------------------------------------------------------------- /playground/transform-plugin/index.js: -------------------------------------------------------------------------------- 1 | // 'TRANSFORM_COUNT' is injected by the transform plugin 2 | document.getElementById('transform-count').innerHTML = TRANSFORM_COUNT 3 | -------------------------------------------------------------------------------- /packages/create-vite/template-vue/src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import './style.css' 3 | import App from './App.vue' 4 | 5 | createApp(App).mount('#app') 6 | -------------------------------------------------------------------------------- /playground/css-dynamic-import/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-css-dynamic-import", 3 | "private": true, 4 | "type": "module", 5 | "version": "0.0.0" 6 | } 7 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/main-non-accepted/main-non-accepted.ts: -------------------------------------------------------------------------------- 1 | import { a } from './named' 2 | import def from './default' 3 | 4 | console.log(`>>>>>> ${a} ${def}`) 5 | -------------------------------------------------------------------------------- /playground/html/side-effects/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-html-side-effects", 3 | "private": true, 4 | "version": "0.0.0", 5 | "sideEffects": false 6 | } 7 | -------------------------------------------------------------------------------- /playground/legacy/async.js: -------------------------------------------------------------------------------- 1 | export function fn() { 2 | const m = new Map() 3 | m.set('foo', 'Hello') 4 | document.querySelector('#app').textContent = m.get('foo') 5 | } 6 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-node-env/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-node-env", 3 | "private": true, 4 | "version": "1.0.0", 5 | "type": "module" 6 | } 7 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-not-js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-not-js", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "index.notjs" 6 | } 7 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-with-dynamic-import/index.js: -------------------------------------------------------------------------------- 1 | export const lazyFoo = async function () { 2 | const { foo } = await import('./dynamic.js') 3 | return foo 4 | } 5 | -------------------------------------------------------------------------------- /playground/optimize-deps/index.astro: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /playground/preserve-symlinks/module-a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-module-a", 3 | "private": true, 4 | "version": "0.0.0", 5 | "main": "linked.js" 6 | } 7 | -------------------------------------------------------------------------------- /playground/resolve/browser-field/out/esm.browser.js: -------------------------------------------------------------------------------- 1 | import jsdom from 'jsdom' // should be redirected to empty module 2 | export default '[success] resolve browser field' 3 | -------------------------------------------------------------------------------- /playground/resolve/exports-with-module-condition/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-commonjs */ 2 | module.exports.msg = '[fail] exports with module condition (index.js)' 3 | -------------------------------------------------------------------------------- /playground/ssr-deps/define-properties-exports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-define-properties-exports", 3 | "private": true, 4 | "version": "0.0.0" 5 | } 6 | -------------------------------------------------------------------------------- /packages/create-vite/template-vue-ts/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import './style.css' 3 | import App from './App.vue' 4 | 5 | createApp(App).mount('#app') 6 | -------------------------------------------------------------------------------- /playground/css/async/async-3.js: -------------------------------------------------------------------------------- 1 | import { createButton } from './base' 2 | import styles from './async-3.module.css' 3 | 4 | createButton(`${styles['async-pink']} modules-pink`) 5 | -------------------------------------------------------------------------------- /playground/fs-serve/entry.js: -------------------------------------------------------------------------------- 1 | import { msg } from './nested/foo' 2 | 3 | export const fullmsg = msg + 'bar' 4 | 5 | document.querySelector('.nested-entry').textContent = fullmsg 6 | -------------------------------------------------------------------------------- /playground/json/json-bom/has-bom.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "This file is marked with BOM.", 3 | "message": "If the parsing is successful, the BOM tag has been removed." 4 | } 5 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-e/index.js: -------------------------------------------------------------------------------- 1 | export { testIncluded } from '@vitejs/test-package-e-included' 2 | export { testExcluded } from '@vitejs/test-package-e-excluded' 3 | -------------------------------------------------------------------------------- /playground/optimize-deps/nested-include/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-nested-include", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /playground/preload/dep-a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-a", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "main": "index.js" 7 | } 8 | -------------------------------------------------------------------------------- /playground/ssr-deps/import-builtin-cjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-import-builtin", 3 | "private": true, 4 | "type": "commonjs", 5 | "version": "0.0.0" 6 | } 7 | -------------------------------------------------------------------------------- /playground/ssr-deps/no-external-cjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-no-external-cjs", 3 | "private": true, 4 | "type": "commonjs", 5 | "version": "0.0.0" 6 | } 7 | -------------------------------------------------------------------------------- /playground/ssr-deps/no-external-css/index.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Not Real Sans'; 3 | src: url('./i-throw-if-you-optimize-this-file.woff') format('woff'); 4 | } 5 | -------------------------------------------------------------------------------- /playground/ssr-deps/only-object-assigned-exports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-only-object-assigned-exports", 3 | "private": true, 4 | "version": "0.0.0" 5 | } 6 | -------------------------------------------------------------------------------- /playground/tsconfig-json-load-error/has-error/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // this config is deliberately malformed to test how vite handles broken tsconfig 3 | "compilerOptions": 4 | } -------------------------------------------------------------------------------- /playground/worker/worker/main.js: -------------------------------------------------------------------------------- 1 | /* flag: will replace in vite config import("./format-es.js") */ 2 | import('./main-module') 3 | import('./main-classic') 4 | import('./main-url') 5 | -------------------------------------------------------------------------------- /playground/assets-sanitize/+circle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /playground/assets-sanitize/_circle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /playground/css-codesplit/order/insert.js: -------------------------------------------------------------------------------- 1 | const style = document.createElement('style') 2 | style.textContent = '.order-bulk { color: orange; }' 3 | document.head.appendChild(style) 4 | -------------------------------------------------------------------------------- /playground/css/css-proxy-dep-nested/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-css-proxy-dep-nested", 3 | "private": true, 4 | "version": "1.0.0", 5 | "style": "index.css" 6 | } 7 | -------------------------------------------------------------------------------- /playground/dynamic-import/pkg/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-pkg", 3 | "type": "module", 4 | "private": true, 5 | "version": "1.0.0", 6 | "main": "index.js" 7 | } 8 | -------------------------------------------------------------------------------- /playground/optimize-deps/added-in-entries/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-added-in-entries", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-css-require/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-css-require", 3 | "private": true, 4 | "version": "0.0.0", 5 | "main": "index.cjs" 6 | } 7 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-non-optimized/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-non-optimized", 3 | "private": true, 4 | "version": "1.0.0", 5 | "type": "module" 6 | } 7 | -------------------------------------------------------------------------------- /playground/ssr-deps/linked-no-external/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-linked-no-external", 3 | "private": true, 4 | "type": "module", 5 | "version": "0.0.0" 6 | } 7 | -------------------------------------------------------------------------------- /.stackblitz/codeflow.json: -------------------------------------------------------------------------------- 1 | { 2 | "pnpm": { 3 | "overrides": { 4 | "vite": "./packages/vite", 5 | "@vitejs/plugin-legacy": "./packages/plugin-legacy" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /playground/css/css-js-dep/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-css-js-dep", 3 | "private": true, 4 | "type": "module", 5 | "version": "1.0.0", 6 | "main": "index.js" 7 | } 8 | -------------------------------------------------------------------------------- /playground/css/nested/nested.styl: -------------------------------------------------------------------------------- 1 | .stylus-import 2 | color darkslateblue 3 | 4 | .stylus-import-alias 5 | color darkslateblue 6 | background url('=/nested/icon.png') 10px no-repeat 7 | -------------------------------------------------------------------------------- /playground/glob-import/side-effect/writedom.js: -------------------------------------------------------------------------------- 1 | /* global document */ 2 | document && 3 | (document.querySelector('.side-effect-result').textContent = 4 | 'Hello from side effect') 5 | -------------------------------------------------------------------------------- /playground/glob-import/side-effect/writetodom.js: -------------------------------------------------------------------------------- 1 | /* global document */ 2 | document && 3 | (document.querySelector('.side-effect-result').textContent = 4 | 'Hello from side effect') 5 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/export-from/export-from.ts: -------------------------------------------------------------------------------- 1 | import { a } from './hub' 2 | 3 | console.log(a) 4 | 5 | if (import.meta.hot) { 6 | import.meta.hot.accept() 7 | } else { 8 | } 9 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-cjs-with-assets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-cjs-with-assets", 3 | "private": true, 4 | "version": "0.0.0", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /playground/optimize-deps/glob/foo.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | 3 | axios.get('/ping').then((res) => { 4 | document.querySelector('.cjs-browser-field').textContent = res.data 5 | }) 6 | -------------------------------------------------------------------------------- /playground/optimize-deps/non-optimizable-include/index.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Not Real Sans'; 3 | src: url('./i-throw-if-you-optimize-this-file.woff') format('woff'); 4 | } 5 | -------------------------------------------------------------------------------- /playground/ssr-deps/external-using-external-entry/index.js: -------------------------------------------------------------------------------- 1 | import getMessage from 'external-entry/entry' 2 | 3 | export default { 4 | hello() { 5 | return getMessage() 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /playground/css-dynamic-import/dynamic.js: -------------------------------------------------------------------------------- 1 | import './dynamic.css' 2 | 3 | export const lazyLoad = async () => { 4 | await import('./static.js') 5 | document.body.classList.add('loaded') 6 | } 7 | -------------------------------------------------------------------------------- /playground/hmr/file-delete-restore/index.js: -------------------------------------------------------------------------------- 1 | import { render } from './runtime' 2 | import { childValue, parentValue } from './parent' 3 | 4 | render({ parent: parentValue, child: childValue }) 5 | -------------------------------------------------------------------------------- /playground/html/zeroJS.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

zeroJS.html

4 | 5 | 10 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-optimize-with-glob/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-optimize-with-glob", 3 | "private": true, 4 | "version": "1.0.0", 5 | "type": "module" 6 | } 7 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-relative-to-main/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-relative-to-main", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "lib/main.js" 6 | } 7 | -------------------------------------------------------------------------------- /playground/preload/src/hello.js: -------------------------------------------------------------------------------- 1 | import style from './hello.module.css' 2 | 3 | const msg = document.querySelector('#hello .msg') 4 | msg.textContent = 'hello' 5 | msg.classList.add(style.h1) 6 | -------------------------------------------------------------------------------- /playground/resolve-linked/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-resolve-linked", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "main": "src/index.js" 7 | } 8 | -------------------------------------------------------------------------------- /packages/create-vite/template-preact/src/main.jsx: -------------------------------------------------------------------------------- 1 | import { render } from 'preact' 2 | import { App } from './app.jsx' 3 | import './index.css' 4 | 5 | render(, document.getElementById('app')) 6 | -------------------------------------------------------------------------------- /playground/html/inline/common.js: -------------------------------------------------------------------------------- 1 | import './dep1' 2 | import './dep2' 3 | 4 | export function log(name) { 5 | document.getElementById('output').innerHTML += name + ' ' 6 | } 7 | 8 | log('common') 9 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-package-a", 3 | "private": true, 4 | "version": "1.0.0", 5 | "type": "module", 6 | "main": "index.js" 7 | } 8 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-package-b", 3 | "private": true, 4 | "version": "1.0.0", 5 | "type": "module", 6 | "main": "index.js" 7 | } 8 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-f/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-package-f", 3 | "private": true, 4 | "version": "2.0.0", 5 | "type": "module", 6 | "main": "index.js" 7 | } 8 | -------------------------------------------------------------------------------- /playground/optimize-deps-no-discovery/dep-no-discovery/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-no-discovery", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /playground/resolve/require-pkg-with-module-field/dep.cjs: -------------------------------------------------------------------------------- 1 | const BigNumber = require('bignumber.js') 2 | 3 | const x = new BigNumber('1111222233334444555566') 4 | 5 | module.exports = x.toString() 6 | -------------------------------------------------------------------------------- /playground/ssr-deps/nested-external-cjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nested-external-cjs", 3 | "private": true, 4 | "version": "0.0.0", 5 | "main": "index.js", 6 | "type": "commonjs" 7 | } 8 | -------------------------------------------------------------------------------- /playground/ssr-resolve/deep-import/bar/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "0.0.0", 4 | "type": "module", 5 | "main": "../utils/bar.js", 6 | "module": "../utils/bar.js" 7 | } 8 | -------------------------------------------------------------------------------- /playground/ssr-resolve/deep-import/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-deep-import", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "module": "index.js" 7 | } 8 | -------------------------------------------------------------------------------- /playground/worker/dep-to-optimize/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-to-optimize", 3 | "private": true, 4 | "version": "1.0.0", 5 | "type": "module", 6 | "main": "index.js" 7 | } 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /playground/build-old/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | 3 | export default defineConfig({ 4 | build: { 5 | // old browsers only 6 | target: ['chrome60'], 7 | }, 8 | }) 9 | -------------------------------------------------------------------------------- /playground/css-codesplit-cjs/main.js: -------------------------------------------------------------------------------- 1 | import './style.css' 2 | import './main.css' 3 | 4 | document.getElementById( 5 | 'app', 6 | ).innerHTML = `

This should be red

This should be blue

` 7 | -------------------------------------------------------------------------------- /playground/css/postcss-caching/blue-app/main.js: -------------------------------------------------------------------------------- 1 | import css from './imported.css' 2 | text('.imported-css', css) 3 | 4 | function text(el, text) { 5 | document.querySelector(el).textContent = text 6 | } 7 | -------------------------------------------------------------------------------- /playground/html/noBody.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Hello

5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /playground/html/noHead.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Hello

5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /playground/multiple-entrypoints/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
Initial
6 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-d/test-package-d-nested/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-package-d-nested", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-e/test-package-e-included/index.js: -------------------------------------------------------------------------------- 1 | import { testExcluded } from 'test-package-e-excluded' 2 | 3 | export function testIncluded() { 4 | return testExcluded() 5 | } 6 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-cjs-compiled-from-cjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-cjs-compiled-from-cjs", 3 | "private": true, 4 | "version": "0.0.0", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-cjs-compiled-from-esm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-cjs-compiled-from-esm", 3 | "private": true, 4 | "version": "0.0.0", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /playground/resolve/inline-package/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-inline-package", 3 | "private": true, 4 | "version": "0.0.0", 5 | "sideEffects": false, 6 | "main": "./inline" 7 | } 8 | -------------------------------------------------------------------------------- /playground/ssr-deps/nested-external/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-nested-external", 3 | "private": true, 4 | "version": "0.0.0", 5 | "main": "index.js", 6 | "type": "module" 7 | } 8 | -------------------------------------------------------------------------------- /playground/tsconfig-json/nested-with-extends/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "include": ["./"], 4 | "compilerOptions": { 5 | "useDefineForClassFields": false 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # chore: enable prettier trailing commas (#11167) 2 | 134ce6817984bad0f5fb043481502531fee9b1db 3 | # chore: rename test packages (#11172) 4 | 5170e44920458090b8b43ee9cfe5010c25dfe22b 5 | -------------------------------------------------------------------------------- /playground/css/postcss-caching/green-app/main.js: -------------------------------------------------------------------------------- 1 | import css from './imported.css' 2 | text('.imported-css', css) 3 | 4 | function text(el, text) { 5 | document.querySelector(el).textContent = text 6 | } 7 | -------------------------------------------------------------------------------- /playground/extensions/index.html: -------------------------------------------------------------------------------- 1 |
Hello Vite!
2 | 3 | 7 | -------------------------------------------------------------------------------- /playground/html/link-props/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

test color

5 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-with-builtin-module-cjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-with-builtin-module-cjs", 3 | "private": true, 4 | "version": "0.0.0", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /playground/tailwind/postcss.config.ts: -------------------------------------------------------------------------------- 1 | // postcss.config.ts 2 | module.exports = { 3 | plugins: { 4 | tailwindcss: { config: __dirname + '/tailwind.config.js' }, 5 | autoprefixer: {}, 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /playground/tailwind/src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | // import '../index.css'; 5 | 6 | createApp(App).use(router).mount('#app') 7 | -------------------------------------------------------------------------------- /packages/create-vite/template-svelte/src/main.js: -------------------------------------------------------------------------------- 1 | import './app.css' 2 | import App from './App.svelte' 3 | 4 | const app = new App({ 5 | target: document.getElementById('app'), 6 | }) 7 | 8 | export default app 9 | -------------------------------------------------------------------------------- /playground/css-codesplit/other.js: -------------------------------------------------------------------------------- 1 | import './style.css' 2 | import './chunk.css' 3 | import chunkCssUrl from './chunk.css?url' 4 | 5 | // use this to not treeshake 6 | globalThis.__test_chunkCssUrl = chunkCssUrl 7 | -------------------------------------------------------------------------------- /playground/css/css-dep/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-css-dep", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "index.js", 6 | "style": "index.css", 7 | "sass": "index.scss" 8 | } 9 | -------------------------------------------------------------------------------- /playground/define/commonjs-dep/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | defined: __STRINGIFIED_OBJ__, 3 | importMetaEnvUndefined: 'import.meta.env.UNDEFINED', 4 | processEnvUndefined: 'process.env.UNDEFINED', 5 | } 6 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-cjs-compiled-from-esm/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | Object.defineProperty(exports, '__esModule', { value: true }) 3 | function foo() { 4 | return 'foo' 5 | } 6 | exports.default = foo 7 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-with-optional-peer-dep/index.js: -------------------------------------------------------------------------------- 1 | export function callItself() { 2 | return '[success]' 3 | } 4 | 5 | export async function callPeerDep() { 6 | return await import('foobar') 7 | } 8 | -------------------------------------------------------------------------------- /playground/resolve/browser-module-field3/index.web.js: -------------------------------------------------------------------------------- 1 | var browserModuleField3 = (function () { 2 | 'use strict' 3 | 4 | var main = '[fail] this should not run in the browser' 5 | 6 | return main 7 | })() 8 | -------------------------------------------------------------------------------- /playground/ssr-deps/define-properties-exports/index.js: -------------------------------------------------------------------------------- 1 | // prettier-ignore 2 | Object.defineProperties ( exports , { 3 | hello: { 4 | value() { 5 | return 'Hello World!' 6 | } 7 | } 8 | }) 9 | -------------------------------------------------------------------------------- /packages/create-vite/template-preact-ts/src/main.tsx: -------------------------------------------------------------------------------- 1 | import { render } from 'preact' 2 | import { App } from './app.tsx' 3 | import './index.css' 4 | 5 | render(, document.getElementById('app') as HTMLElement) 6 | -------------------------------------------------------------------------------- /packages/create-vite/template-svelte-ts/src/main.ts: -------------------------------------------------------------------------------- 1 | import './app.css' 2 | import App from './App.svelte' 3 | 4 | const app = new App({ 5 | target: document.getElementById('app'), 6 | }) 7 | 8 | export default app 9 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/main-accepted/callback.ts: -------------------------------------------------------------------------------- 1 | export const x = 'X' 2 | 3 | if (import.meta.hot) { 4 | import.meta.hot.acceptExports(['x'], (m) => { 5 | console.log(`reloaded >>> ${m.x}`) 6 | }) 7 | } 8 | -------------------------------------------------------------------------------- /playground/lib/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 10 | -------------------------------------------------------------------------------- /playground/resolve/exports-with-module-condition-required/index.cjs: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-commonjs */ 2 | const { msg } = require('@vitejs/test-resolve-exports-with-module-condition') 3 | module.exports = { msg } 4 | -------------------------------------------------------------------------------- /playground/ssr/src/forked-deadlock/stuck-module.js: -------------------------------------------------------------------------------- 1 | import { middleModuleExport } from './middle-module' 2 | 3 | /** 4 | * module X 5 | */ 6 | export function stuckModuleExport() { 7 | middleModuleExport() 8 | } 9 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/plugins/importGlob/fixture-a/modules/index.ts: -------------------------------------------------------------------------------- 1 | export { name as a } from './a' 2 | export { name as b } from './b' 3 | 4 | export const name = 'index' 5 | 6 | export default 'indexDefault' 7 | -------------------------------------------------------------------------------- /playground/css-sourcemap/input-map.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "sources": ["input-map.src.css"], 4 | "sourcesContent": [".input-map {\n color: blue;\n}"], 5 | "mappings": "AAAA,WACE", 6 | "names": [] 7 | } 8 | -------------------------------------------------------------------------------- /playground/css/less/components/form.less: -------------------------------------------------------------------------------- 1 | .form-box-data-uri { 2 | // data-uri() calls with relative paths should be replaced just like urls. 3 | background-image: data-uri('../images/backgrounds/form-select.svg'); 4 | } 5 | -------------------------------------------------------------------------------- /playground/import-assertion/import-assertion-dep/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-import-assertion-dep", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "exports": "./index.js" 7 | } 8 | -------------------------------------------------------------------------------- /playground/multiple-entrypoints/entrypoints/a24.js: -------------------------------------------------------------------------------- 1 | export const that = () => import('./a23.js') 2 | 3 | export function other() { 4 | return 5 | } 6 | 7 | export default function () { 8 | return 123 9 | } 10 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-with-dynamic-import/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-with-dynamic-import", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "main": "index.js" 7 | } 8 | -------------------------------------------------------------------------------- /playground/resolve/custom-main-field/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-resolve-custom-main-field", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "index.js", 6 | "custom": "index.custom.js" 7 | } 8 | -------------------------------------------------------------------------------- /playground/ssr-pug/index.pug: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | meta(charset='UTF-8') 5 | meta(name='viewport' content='width=device-width, initial-scale=1.0') 6 | title SSR Pug 7 | body 8 | h1 SSR Pug 9 | -------------------------------------------------------------------------------- /playground/worker/sub-worker.js: -------------------------------------------------------------------------------- 1 | self.onmessage = (event) => { 2 | if (event.data === 'ping') { 3 | self.postMessage(`pong ${self.location.href}`) 4 | } 5 | } 6 | 7 | // for sourcemap 8 | console.log('sub-worker.js') 9 | -------------------------------------------------------------------------------- /packages/create-vite/template-vue/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import vue from '@vitejs/plugin-vue' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [vue()], 7 | }) 8 | -------------------------------------------------------------------------------- /playground/config/packages/siblings/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vite/test-config-sibling", 3 | "type": "module", 4 | "devDependencies": { 5 | "@types/lodash": "^4.14.195", 6 | "lodash": "^4.17.21" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /playground/glob-import/escape/{curlies}/glob.js: -------------------------------------------------------------------------------- 1 | const relative = import.meta.glob('./**/*.js', { eager: true }) 2 | const alias = import.meta.glob('@escape_{curlies}_mod/**/*.js', { eager: true }) 3 | export { relative, alias } 4 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-c/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-package-c", 3 | "private": true, 4 | "version": "1.0.0", 5 | "type": "module", 6 | "main": "index.js", 7 | "module": "index-es.js" 8 | } 9 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-e/test-package-e-excluded/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-package-e-excluded", 3 | "private": true, 4 | "version": "0.1.0", 5 | "type": "module", 6 | "main": "index.js" 7 | } 8 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-with-builtin-module-esm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-with-builtin-module-esm", 3 | "private": true, 4 | "version": "0.0.0", 5 | "main": "index.js", 6 | "type": "module" 7 | } 8 | -------------------------------------------------------------------------------- /packages/create-vite/template-vue-ts/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import vue from '@vitejs/plugin-vue' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [vue()], 7 | }) 8 | -------------------------------------------------------------------------------- /playground/config/packages/entry/vite.config.ts: -------------------------------------------------------------------------------- 1 | import moduleCondition from '@vite/test-config-plugin-module-condition' 2 | import { array } from '../siblings/foo' 3 | 4 | export default { 5 | array, 6 | moduleCondition, 7 | } 8 | -------------------------------------------------------------------------------- /playground/hmr/importing-updated/a.js: -------------------------------------------------------------------------------- 1 | const val = 'a0' 2 | document.querySelector('.importing-reloaded').innerHTML += `a.js: ${val}
` 3 | 4 | export default val 5 | 6 | if (import.meta.hot) { 7 | import.meta.hot.accept() 8 | } 9 | -------------------------------------------------------------------------------- /playground/html/scriptMixed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

scriptMixed.html

4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-cjs-browser-field-bare/internal.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // eslint-disable-next-line import/no-nodejs-modules 4 | const events = require('events') 5 | 6 | module.exports = 'foo' in events ? 'pong' : '' 7 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-esbuild-plugin-transform/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-esbuild-plugin-transform", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "main": "index.js" 7 | } 8 | -------------------------------------------------------------------------------- /playground/resolve/browser-module-field2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-resolve-browser-module-field2", 3 | "private": true, 4 | "version": "1.0.0", 5 | "module": "index.js", 6 | "browser": "index.web.js" 7 | } 8 | -------------------------------------------------------------------------------- /playground/resolve/browser-module-field3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-resolve-browser-module-field3", 3 | "private": true, 4 | "version": "1.0.0", 5 | "module": "index.js", 6 | "browser": "index.web.js" 7 | } 8 | -------------------------------------------------------------------------------- /playground/ssr-deps/non-optimized-with-nested-external/index.js: -------------------------------------------------------------------------------- 1 | import { setMessage } from 'nested-external' 2 | import external from 'nested-external-cjs' 3 | 4 | setMessage('Hello World!') 5 | external.setMessage('Hello World!') 6 | -------------------------------------------------------------------------------- /playground/ssr-deps/pkg-exports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-pkg-exports", 3 | "private": true, 4 | "version": "0.0.0", 5 | "exports": { 6 | ".": "./index.js" 7 | }, 8 | "type": "module" 9 | } 10 | -------------------------------------------------------------------------------- /playground/ssr/src/forked-deadlock/fuse-stuck-bridge-module.js: -------------------------------------------------------------------------------- 1 | import { stuckModuleExport } from './stuck-module' 2 | 3 | /** 4 | * module C 5 | */ 6 | export function fuseStuckBridgeModuleExport() { 7 | stuckModuleExport() 8 | } 9 | -------------------------------------------------------------------------------- /playground/tailwind-sourcemap/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | 3 | export default { 4 | content: ['./index.html'], 5 | theme: { 6 | extend: {}, 7 | }, 8 | plugins: [], 9 | } 10 | -------------------------------------------------------------------------------- /playground/wasm/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | export default defineConfig({ 3 | build: { 4 | // make cannot emit light.wasm 5 | // and emit add.wasm 6 | assetsInlineLimit: 80, 7 | }, 8 | }) 9 | -------------------------------------------------------------------------------- /playground/worker/module-and-worker.js: -------------------------------------------------------------------------------- 1 | import constant from './modules/module0' 2 | 3 | self.postMessage(constant) 4 | 5 | export const module = 'module and worker' 6 | 7 | // for sourcemap 8 | console.log('module-and-worker.js') 9 | -------------------------------------------------------------------------------- /packages/create-vite/template-preact/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import preact from '@preact/preset-vite' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [preact()], 7 | }) 8 | -------------------------------------------------------------------------------- /packages/create-vite/template-react/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /playground/config/packages/entry/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vite/test-config-entry", 3 | "type": "module", 4 | "dependencies": { 5 | "@vite/test-config-plugin-module-condition": "link:../plugin-module-condition" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/unused-exports/used.ts: -------------------------------------------------------------------------------- 1 | export const foo = 'foo0' 2 | 3 | export const bar = 'bar0' 4 | 5 | console.log('-- used --') 6 | 7 | if (import.meta.hot) { 8 | import.meta.hot.acceptExports([]) 9 | } 10 | -------------------------------------------------------------------------------- /playground/html/scriptAsync.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

scriptAsync.html

4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /playground/proxy-hmr/other-app/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | 3 | export default defineConfig({ 4 | base: '/anotherApp', 5 | server: { 6 | port: 9607, 7 | strictPort: true, 8 | }, 9 | }) 10 | -------------------------------------------------------------------------------- /playground/ssr-deps/no-external-css/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-no-external-css", 3 | "private": true, 4 | "type": "module", 5 | "version": "0.0.0", 6 | "exports": { 7 | ".": "./index.css" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /playground/ssr/src/forked-deadlock/middle-module.js: -------------------------------------------------------------------------------- 1 | import { deadlockfuseModuleExport } from './deadlock-fuse-module' 2 | 3 | /** 4 | * module Y 5 | */ 6 | export function middleModuleExport() { 7 | void deadlockfuseModuleExport 8 | } 9 | -------------------------------------------------------------------------------- /playground/tailwind-sourcemap/index.html: -------------------------------------------------------------------------------- 1 |
2 |

Tailwind Sourcemap

3 | 4 |

foo

5 |
6 | 7 | 10 | -------------------------------------------------------------------------------- /playground/tailwind-sourcemap/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | 3 | export default defineConfig({ 4 | css: { 5 | devSourcemap: true, 6 | }, 7 | build: { 8 | sourcemap: true, 9 | }, 10 | }) 11 | -------------------------------------------------------------------------------- /packages/create-vite/template-preact-ts/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import preact from '@preact/preset-vite' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [preact()], 7 | }) 8 | -------------------------------------------------------------------------------- /packages/create-vite/template-react-ts/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /playground/glob-import/escape/[brackets]/glob.js: -------------------------------------------------------------------------------- 1 | const relative = import.meta.glob('./**/*.js', { eager: true }) 2 | const alias = import.meta.glob('@escape_[brackets]_mod/**/*.js', { 3 | eager: true, 4 | }) 5 | export { relative, alias } 6 | -------------------------------------------------------------------------------- /playground/hmr/importing-updated/b.js: -------------------------------------------------------------------------------- 1 | import a from './a.js' 2 | 3 | const val = `b0,${a}` 4 | document.querySelector('.importing-reloaded').innerHTML += `b.js: ${val}
` 5 | 6 | if (import.meta.hot) { 7 | import.meta.hot.accept() 8 | } 9 | -------------------------------------------------------------------------------- /playground/multiple-entrypoints/index.js: -------------------------------------------------------------------------------- 1 | document 2 | .querySelector('.a') 3 | .addEventListener('click', () => import('./dynamic-a')) 4 | document 5 | .querySelector('.b') 6 | .addEventListener('click', () => import('./dynamic-b')) 7 | -------------------------------------------------------------------------------- /playground/object-hooks/__tests__/object-hooks.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect, test } from 'vitest' 2 | import { page } from '~utils' 3 | 4 | test('object hooks', async () => { 5 | expect(await page.textContent('#transform')).toMatch('ok') 6 | }) 7 | -------------------------------------------------------------------------------- /packages/create-vite/template-svelte/src/lib/Counter.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | -------------------------------------------------------------------------------- /packages/vite/src/node/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": ["./", "../dep-types", "../types"], 4 | "exclude": ["**/__tests__"], 5 | "compilerOptions": { 6 | "lib": ["ESNext", "DOM"] 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /playground/css/nested/nested.sss: -------------------------------------------------------------------------------- 1 | .sugarss-at-import 2 | color: darkslateblue 3 | background: url(./icon.png) 10px no-repeat 4 | 5 | 6 | .sugarss-at-import-alias 7 | color: darkslateblue 8 | background: url(=/nested/icon.png) 10px no-repeat 9 | -------------------------------------------------------------------------------- /playground/glob-import/escape/(parenthesis)/glob.js: -------------------------------------------------------------------------------- 1 | const relative = import.meta.glob('./**/*.js', { eager: true }) 2 | const alias = import.meta.glob('@escape_(parenthesis)_mod/**/*.js', { 3 | eager: true, 4 | }) 5 | export { relative, alias } 6 | -------------------------------------------------------------------------------- /playground/legacy/entry-server.js: -------------------------------------------------------------------------------- 1 | // This counts as 'server-side' rendering, yes? 2 | export async function render() { 3 | return /* html */ ` 4 |
Hello
5 |
${import.meta.env.LEGACY}
6 | ` 7 | } 8 | -------------------------------------------------------------------------------- /playground/resolve/sharp-dir/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-resolve-sharp-dir", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "./index.cjs", 6 | "dependencies": { 7 | "es5-ext": "0.10.62" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /playground/ssr-deps/object-assigned-exports/index.js: -------------------------------------------------------------------------------- 1 | Object.defineProperty(exports, '__esModule', { value: true }) 2 | 3 | const obj = { 4 | hello() { 5 | return 'Hello World!' 6 | }, 7 | } 8 | 9 | Object.assign(exports, obj) 10 | -------------------------------------------------------------------------------- /packages/create-vite/template-svelte/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import { svelte } from '@sveltejs/vite-plugin-svelte' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [svelte()], 7 | }) 8 | -------------------------------------------------------------------------------- /playground/extensions/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | 3 | export default defineConfig({ 4 | resolve: { 5 | alias: [{ find: 'vue', replacement: 'vue/dist/vue.esm-bundler.js' }], 6 | extensions: ['.js'], 7 | }, 8 | }) 9 | -------------------------------------------------------------------------------- /playground/ssr-deps/forwarded-export/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-forwarded-export", 3 | "private": true, 4 | "version": "0.0.0", 5 | "dependencies": { 6 | "object-assigned-exports": "file:../object-assigned-exports" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /playground/ssr-resolve/pkg-exports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-resolve-pkg-exports", 3 | "private": true, 4 | "version": "0.0.0", 5 | "exports": { 6 | ".": "./index.js", 7 | "./entry": "./entry.js" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /playground/worker/emit-chunk-dynamic-import-worker.js: -------------------------------------------------------------------------------- 1 | import('./modules/module0').then((module) => { 2 | self.postMessage(module.default + import.meta.env.BASE_URL) 3 | }) 4 | 5 | // for sourcemap 6 | console.log('emit-chunk-dynamic-import-worker.js') 7 | -------------------------------------------------------------------------------- /playground/worker/importMetaGlob.worker.js: -------------------------------------------------------------------------------- 1 | const modules = import.meta.glob('./modules/*js') 2 | 3 | self.onmessage = function (e) { 4 | self.postMessage(Object.keys(modules)) 5 | } 6 | 7 | // for sourcemap 8 | console.log('importMetaGlob.worker.js') 9 | -------------------------------------------------------------------------------- /packages/create-vite/template-svelte-ts/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import { svelte } from '@sveltejs/vite-plugin-svelte' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [svelte()], 7 | }) 8 | -------------------------------------------------------------------------------- /playground/backend-integration/references.css: -------------------------------------------------------------------------------- 1 | .asset-reference { 2 | display: grid; 3 | grid-template-areas: 4 | 'summary preview .' 5 | 'url url url'; 6 | } 7 | 8 | .asset-url { 9 | grid-area: url; 10 | white-space: nowrap; 11 | } 12 | -------------------------------------------------------------------------------- /playground/css/async.js: -------------------------------------------------------------------------------- 1 | import './async.css' 2 | 3 | const div = document.createElement('div') 4 | div.className = 'async' 5 | document.body.appendChild(div) 6 | div.textContent = `async chunk (this should be teal) ${ 7 | getComputedStyle(div).color 8 | }` 9 | -------------------------------------------------------------------------------- /playground/css/less/images/backgrounds/form-select.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /playground/legacy/entry-server-sequential.js: -------------------------------------------------------------------------------- 1 | // This counts as 'server-side' rendering, yes? 2 | export async function render() { 3 | return /* html */ ` 4 |
Hello
5 |
${import.meta.env.MODE}
6 | ` 7 | } 8 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-linked-include/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-linked-include", 3 | "private": true, 4 | "version": "0.0.0", 5 | "main": "index.mjs", 6 | "dependencies": { 7 | "react": "18.2.0" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /playground/resolve/exports-from-root/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-resolve-exports-from-root", 3 | "private": true, 4 | "version": "1.0.0", 5 | "exports": { 6 | ".": "./index.js", 7 | "./nested": "./file.js" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /playground/ssr-noexternal/external-cjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-external-cjs", 3 | "private": true, 4 | "version": "0.0.0", 5 | "exports": { 6 | "require": "./require.cjs", 7 | "import": "./import.mjs" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /playground/ssr/src/forked-deadlock/deadlock-fuse-module.js: -------------------------------------------------------------------------------- 1 | import { fuseStuckBridgeModuleExport } from './fuse-stuck-bridge-module' 2 | 3 | /** 4 | * module A 5 | */ 6 | export function deadlockfuseModuleExport() { 7 | fuseStuckBridgeModuleExport() 8 | } 9 | -------------------------------------------------------------------------------- /playground/worker/url-worker.js: -------------------------------------------------------------------------------- 1 | self.postMessage( 2 | [ 3 | 'A string', 4 | import.meta.env.BASE_URL, 5 | self.location.url, 6 | import.meta.url, 7 | ].join(' '), 8 | ) 9 | 10 | // for sourcemap 11 | console.log('url-worker.js') 12 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | hoist-pattern[]=ts-node # package/vite: postcss-load-config 2 | hoist-pattern[]=postcss # package/vite 3 | hoist-pattern[]=pug # playground/tailwind: @vue/compiler-sfc 4 | strict-peer-dependencies=false 5 | shell-emulator=true 6 | auto-install-peers=false 7 | -------------------------------------------------------------------------------- /packages/vite/src/node/__tests__/plugins/importGlob/fixture-a/node_modules/framework/pages/hello.page.js: -------------------------------------------------------------------------------- 1 | // A fake Page file. (This technique of globbing into `node_modules/` 2 | // is used by vite-plugin-ssr frameworks and Hydrogen.) 3 | 4 | export const a = 1 5 | -------------------------------------------------------------------------------- /playground/css-lightningcss/imported.css: -------------------------------------------------------------------------------- 1 | @import './imported-at-import.css'; 2 | 3 | .imported { 4 | color: green; 5 | } 6 | 7 | pre { 8 | background-color: #eee; 9 | width: 500px; 10 | padding: 1em 1.5em; 11 | border-radius: 10px; 12 | } 13 | -------------------------------------------------------------------------------- /playground/css/layered/index.css: -------------------------------------------------------------------------------- 1 | @layer base; 2 | 3 | @import './blue.css' layer; 4 | @import './green.css' layer; 5 | 6 | @layer base { 7 | .layers-blue { 8 | color: black; 9 | } 10 | .layers-green { 11 | color: black; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/main-accepted/main-accepted.ts: -------------------------------------------------------------------------------- 1 | import def, { a } from './target' 2 | import { x } from './callback' 3 | 4 | // we don't want to pollute other checks' logs... 5 | if (0 > 1) console.log(x) 6 | 7 | console.log(`>>>>>> ${a} ${def}`) 8 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/unused-exports/unused.ts: -------------------------------------------------------------------------------- 1 | export const x = 'x' 2 | 3 | export const y = 'y' 4 | 5 | export default 'z' 6 | 7 | console.log('-- unused --') 8 | 9 | if (import.meta.hot) { 10 | import.meta.hot.acceptExports([]) 11 | } 12 | -------------------------------------------------------------------------------- /playground/multiple-entrypoints/entrypoints/a23.js: -------------------------------------------------------------------------------- 1 | import a24 from './a24' 2 | 3 | export const that = () => import('./a22.js') 4 | 5 | export function other() { 6 | return a24() 7 | } 8 | 9 | export default function () { 10 | return 123 11 | } 12 | -------------------------------------------------------------------------------- /playground/optimize-deps/non-optimizable-include/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-non-optimizable-include", 3 | "private": true, 4 | "type": "module", 5 | "version": "0.0.0", 6 | "exports": { 7 | ".": "./index.css" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /playground/ssr-deps/read-file-content/index.js: -------------------------------------------------------------------------------- 1 | const path = require('node:path') 2 | 3 | module.exports = async function readFileContent(filePath) { 4 | const fs = require('node:fs/promises') 5 | return await fs.readFile(path.resolve(filePath), 'utf-8') 6 | } 7 | -------------------------------------------------------------------------------- /playground/ssr/src/circular-dep-init/module-b.js: -------------------------------------------------------------------------------- 1 | import { valueA } from './circular-dep-init' 2 | 3 | export const valueB = 'circ-dep-init-b' 4 | export const valueAB = valueA.concat(` ${valueB}`) 5 | 6 | export function getValueAB() { 7 | return valueAB 8 | } 9 | -------------------------------------------------------------------------------- /packages/create-vite/template-svelte-ts/src/lib/Counter.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | -------------------------------------------------------------------------------- /packages/vite/src/types/anymatch.d.ts: -------------------------------------------------------------------------------- 1 | export type AnymatchFn = (testString: string) => boolean 2 | export type AnymatchPattern = string | RegExp | AnymatchFn 3 | type AnymatchMatcher = AnymatchPattern | AnymatchPattern[] 4 | 5 | export { AnymatchMatcher as Matcher } 6 | -------------------------------------------------------------------------------- /playground/css/less.less: -------------------------------------------------------------------------------- 1 | @import '=/nested/nested'; 2 | @import './nested/css-in-less.less'; 3 | 4 | // Test data-uri calls with relative images. 5 | @import './less/components/form.less'; 6 | 7 | @color: blue; 8 | 9 | .less { 10 | color: @color; 11 | } 12 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-non-optimized/index.js: -------------------------------------------------------------------------------- 1 | // Scheme check that imports from different paths are resolved to the same module 2 | const messages = [] 3 | export const add = (message) => { 4 | messages.push(message) 5 | } 6 | export const get = () => messages 7 | -------------------------------------------------------------------------------- /playground/resolve/browser-field-bare-import-fail/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-resolve-browser-field-bare-import-fail", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "main.js", 6 | "module": "module.js", 7 | "type": "module" 8 | } 9 | -------------------------------------------------------------------------------- /playground/ssr-deps/ts-transpiled-exports/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | Object.defineProperty(exports, '__esModule', { value: true }) 3 | exports.hello = void 0 4 | function hello() { 5 | return 'Hello World!' 6 | } 7 | exports.hello = hello 8 | exports.default = hello 9 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build.environment] 2 | NODE_VERSION = "16" 3 | # don't need playwright for docs build 4 | PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1" 5 | [build] 6 | publish = "docs/.vitepress/dist" 7 | command = "pnpm ci-docs" 8 | ignore = "./scripts/docs-check.sh" 9 | -------------------------------------------------------------------------------- /packages/create-vite/template-svelte-ts/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "skipLibCheck": true, 5 | "module": "ESNext", 6 | "moduleResolution": "bundler" 7 | }, 8 | "include": ["vite.config.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/vite/types/metadata.d.ts: -------------------------------------------------------------------------------- 1 | export interface ChunkMetadata { 2 | importedAssets: Set 3 | importedCss: Set 4 | } 5 | 6 | declare module 'rollup' { 7 | export interface RenderedChunk { 8 | viteMetadata?: ChunkMetadata 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /playground/glob-import/dir/index.js: -------------------------------------------------------------------------------- 1 | const modules = import.meta.glob('./*.(js|ts)', { eager: true }) 2 | const globWithAlias = import.meta.glob('@dir/al*.js', { eager: true }) 3 | 4 | // test for sourcemap 5 | console.log('hello') 6 | 7 | export { modules, globWithAlias } 8 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/main-non-accepted/default.ts: -------------------------------------------------------------------------------- 1 | export const x = 'y' 2 | 3 | const def = 'def0' 4 | 5 | export default def 6 | 7 | console.log(`<<< default: ${def}`) 8 | 9 | if (import.meta.hot) { 10 | import.meta.hot.acceptExports(['x']) 11 | } 12 | -------------------------------------------------------------------------------- /playground/hmr/invalidation/parent.js: -------------------------------------------------------------------------------- 1 | import { value } from './child' 2 | 3 | if (import.meta.hot) { 4 | import.meta.hot.accept() 5 | } 6 | 7 | console.log('(invalidation) parent is executing') 8 | 9 | document.querySelector('.invalidation').innerHTML = value 10 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-linked/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-linked", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "main": "index.js", 7 | "dependencies": { 8 | "lodash-es": "^4.17.21" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /playground/optimize-missing-deps/multi-entry-dep/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-multi-entry-dep", 3 | "private": true, 4 | "version": "0.0.0", 5 | "main": "index.js", 6 | "browser": { 7 | "./index.js": "./index.browser.js" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /playground/resolve/browser-field-bare-import-success/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-resolve-browser-field-bare-import-success", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "main.js", 6 | "module": "module.js", 7 | "type": "module" 8 | } 9 | -------------------------------------------------------------------------------- /playground/ssr-deps/external-entry/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-external-entry", 3 | "private": true, 4 | "version": "0.0.0", 5 | "exports": { 6 | ".": "./index.js", 7 | "./entry": "./entry.js" 8 | }, 9 | "type": "module" 10 | } 11 | -------------------------------------------------------------------------------- /playground/ssr-deps/optimized-cjs-with-nested-external/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-optimized-cjs-with-nested-external", 3 | "private": true, 4 | "version": "0.0.0", 5 | "dependencies": { 6 | "nested-external": "file:../nested-external" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /playground/worker/url-shared-worker.js: -------------------------------------------------------------------------------- 1 | import constant from './modules/module0.js' 2 | 3 | self.onconnect = (event) => { 4 | const port = event.ports[0] 5 | port.postMessage(constant) 6 | } 7 | 8 | // for sourcemap 9 | console.log('url-shared-worker.js') 10 | -------------------------------------------------------------------------------- /docs/public/_headers: -------------------------------------------------------------------------------- 1 | /assets/* 2 | cache-control: max-age=31536000 3 | cache-control: immutable 4 | 5 | /*.svg 6 | cache-control: max-age=604800 7 | cache-control: immutable 8 | 9 | /*.png 10 | cache-control: max-age=604800 11 | cache-control: immutable 12 | -------------------------------------------------------------------------------- /packages/vite/src/node/ssr/__tests__/ssrExternal.spec.ts: -------------------------------------------------------------------------------- 1 | import { expect, test } from 'vitest' 2 | import { stripNesting } from '../ssrExternal' 3 | 4 | test('stripNesting', async () => { 5 | expect(stripNesting(['c', 'p1>c1', 'p2 > c2'])).toEqual(['c', 'c1', 'c2']) 6 | }) 7 | -------------------------------------------------------------------------------- /playground/html/env.html: -------------------------------------------------------------------------------- 1 |

%VITE_FOO%

2 |

%VITE_NUMBER%

3 |

class name should be env-bar

4 |

%PROD%

5 |

%DEV%

6 | 7 | -------------------------------------------------------------------------------- /playground/lib/src/main2.js: -------------------------------------------------------------------------------- 1 | import './index.css' 2 | 3 | export default async function message(sel) { 4 | const message = await import('./message.js') 5 | 6 | await import('./dynamic.css') 7 | 8 | document.querySelector(sel).textContent = message.default 9 | } 10 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-cjs-browser-field-bare/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-cjs-browser-field-bare", 3 | "private": true, 4 | "version": "0.0.0", 5 | "main": "index.js", 6 | "browser": { 7 | "events": "./events-shim.js" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /playground/hmr/accept-exports/main-non-accepted/named.ts: -------------------------------------------------------------------------------- 1 | import dep from './dep' 2 | 3 | export const a = 'A0' 4 | 5 | export const b = 'B0' 6 | 7 | console.log(`<<< named: ${a} ; ${dep}`) 8 | 9 | if (import.meta.hot) { 10 | import.meta.hot.acceptExports(['b']) 11 | } 12 | -------------------------------------------------------------------------------- /playground/optimize-deps/dep-alias-using-absolute-path/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-alias-using-absolute-path", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "index.js", 6 | "dependencies": { 7 | "lodash": "^4.17.21" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /playground/proxy-hmr/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-proxy-hmr", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "preview": "vite preview" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /playground/resolve/require-pkg-with-module-field/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-require-pkg-with-module-field", 3 | "private": true, 4 | "version": "1.0.0", 5 | "main": "./index.cjs", 6 | "dependencies": { 7 | "bignumber.js": "9.1.1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /playground/worker/importMetaGlobEager.worker.js: -------------------------------------------------------------------------------- 1 | const modules = import.meta.glob('./modules/*js', { eager: true }) 2 | 3 | self.onmessage = function (e) { 4 | self.postMessage(Object.keys(modules)) 5 | } 6 | 7 | // for sourcemap 8 | console.log('importMetaGlobEager.worker.js') 9 | -------------------------------------------------------------------------------- /packages/vite/src/client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": ["./", "../types"], 4 | "compilerOptions": { 5 | "types": [], 6 | "target": "ES2019", 7 | "lib": ["ESNext", "DOM"], 8 | "declaration": false 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /playground/assets-sanitize/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | 3 | export default defineConfig({ 4 | build: { 5 | //speed up build 6 | minify: false, 7 | target: 'esnext', 8 | assetsInlineLimit: 0, 9 | manifest: true, 10 | }, 11 | }) 12 | -------------------------------------------------------------------------------- /playground/css-codesplit/order/index.js: -------------------------------------------------------------------------------- 1 | import './insert' // inserts "color: orange" 2 | import './base.css' // includes "color: blue" 3 | 4 | document.querySelector('.order-bulk-update').addEventListener('click', () => { 5 | import('./dynamic.css') // includes "color: green" 6 | }) 7 | -------------------------------------------------------------------------------- /playground/css/css-proxy-dep/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-css-proxy-dep", 3 | "private": true, 4 | "version": "1.0.0", 5 | "style": "index.css", 6 | "dependencies": { 7 | "@vitejs/test-css-proxy-dep-nested": "file:../css-proxy-dep-nested" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /playground/hmr/invalidation/child.js: -------------------------------------------------------------------------------- 1 | if (import.meta.hot) { 2 | // Need to accept, to register a callback for HMR 3 | import.meta.hot.accept(() => { 4 | // Trigger HMR in importers 5 | import.meta.hot.invalidate() 6 | }) 7 | } 8 | 9 | export const value = 'child' 10 | -------------------------------------------------------------------------------- /playground/nested-deps/test-package-e/test-package-e-excluded/index.js: -------------------------------------------------------------------------------- 1 | const key = '$$excludedDependencyInstanceCount' 2 | 3 | if (!(key in window)) { 4 | window[key] = 0 5 | } 6 | 7 | ++window[key] 8 | 9 | export function testExcluded() { 10 | return window[key] 11 | } 12 | -------------------------------------------------------------------------------- /playground/preload/dep-including-a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-including-a", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "main": "index.js", 7 | "dependencies": { 8 | "@vitejs/test-dep-a": "file:../dep-a" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /playground/resolve/require-pkg-with-module-field/index.cjs: -------------------------------------------------------------------------------- 1 | const dep = require('./dep.cjs') 2 | 3 | const msg = 4 | dep === '1.111222233334444555566e+21' 5 | ? '[success] require-pkg-with-module-field' 6 | : '[failed] require-pkg-with-module-field' 7 | 8 | exports.msg = msg 9 | -------------------------------------------------------------------------------- /playground/ssr-deps/module-condition/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-module-condition", 3 | "private": true, 4 | "version": "0.0.0", 5 | "exports": { 6 | ".": { 7 | "module": "./module.js", 8 | "import": "./import.mjs" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /playground/tailwind/src/App.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | -------------------------------------------------------------------------------- /scripts/docs-check.sh: -------------------------------------------------------------------------------- 1 | echo "prev commit: $CACHED_COMMIT_REF" 2 | echo "current commit: $COMMIT_REF" 3 | git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF docs package.json pnpm-lock.yaml netlify.toml scripts/docs-check.sh 4 | status=$? 5 | echo "diff exit code: $status" 6 | exit $status 7 | -------------------------------------------------------------------------------- /playground/proxy-hmr/other-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-other-app", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "preview": "vite preview" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /playground/css/async-treeshaken.js: -------------------------------------------------------------------------------- 1 | import './async-treeshaken.css' 2 | 3 | const div = document.createElement('div') 4 | div.className = 'async-treeshaken' 5 | div.textContent = 6 | 'async treeshaken chunk (this should be plum and should not show up in prod)' 7 | document.body.appendChild(div) 8 | -------------------------------------------------------------------------------- /playground/external/dep-that-imports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-that-imports", 3 | "private": true, 4 | "version": "0.0.0", 5 | "dependencies": { 6 | "slash3": "npm:slash@^3.0.0", 7 | "slash5": "npm:slash@^5.1.0", 8 | "vue": "^3.3.4" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /playground/external/dep-that-requires/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vitejs/test-dep-that-requires", 3 | "private": true, 4 | "version": "0.0.0", 5 | "dependencies": { 6 | "slash3": "npm:slash@^3.0.0", 7 | "slash5": "npm:slash@^5.1.0", 8 | "vue": "^3.3.4" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /playground/hmr/file-delete-restore/child.js: -------------------------------------------------------------------------------- 1 | import { rerender } from './runtime' 2 | 3 | export const value = 'child' 4 | 5 | if (import.meta.hot) { 6 | import.meta.hot.accept((newMod) => { 7 | if (!newMod) return 8 | 9 | rerender({ child: newMod.value }) 10 | }) 11 | } 12 | -------------------------------------------------------------------------------- /playground/multiple-entrypoints/entrypoints/a22.js: -------------------------------------------------------------------------------- 1 | import a23 from './a23' 2 | import a24 from './a24' 3 | 4 | export const that = () => import('./a21.js') 5 | 6 | export function other() { 7 | return a23() + a24() 8 | } 9 | 10 | export default function () { 11 | return 123 12 | } 13 | --------------------------------------------------------------------------------