Vite is running in %MODE%
@@ -1712,7 +1712,7 @@ Vite now supports [replacing env variables in HTML files](https://vitejs.dev/gui ### Sourcemaps improvements -The Chrome Dev Tools team has been working to improve the DX of Vite and Vite-powered frameworks in the dev tools. Vite 4.2 brings an [improved experience](https://twitter.com/bmeurer/status/1631286267823439881) and tools for framework authors to [hide 3rd party code and build artifacts from the user](https://twitter.com/bmeurer/status/1631531492462526467) from console log traces using [`server.sourcemapIgnoreList`](https://vitejs.dev/config/server-options.html#server-sourcemapignorelist) and [`build.rollupOptions.output.sourcemapIgnoreList`](https://rollupjs.org/configuration-options/#output-sourcemapignorelist). +The Chrome Dev Tools team has been working to improve the DX of Vite and Vite-powered frameworks in the dev tools. Vite 4.2 brings an [improved experience](https://twitter.com/bmeurer/status/1631286267823439881) and tools for framework authors to [hide 3rd party code and build artifacts from the user](https://twitter.com/bmeurer/status/1631531492462526467) from console log traces using [`server.sourcemapIgnoreList`](https://vite.dev/config/server-options.html#server-sourcemapignorelist) and [`build.rollupOptions.output.sourcemapIgnoreList`](https://rollupjs.org/configuration-options/#output-sourcemapignorelist). ### ESM subpath imports @@ -1739,7 +1739,7 @@ import type { Rollup } from 'vite' ### Português Docs Translation -The Vite documentation is now translated to Português at [pt.vitejs.dev](https://pt.vitejs.dev) thanks to [Nazaré Da Piedade](https://twitter.com/nazarepiedady) . +The Vite documentation is now translated to Português at [pt.vite.dev](https://pt.vite.dev) thanks to [Nazaré Da Piedade](https://twitter.com/nazarepiedady) . ### Features @@ -1871,9 +1871,9 @@ See [4.2.0-beta.0 changelog](https://github.com/vitejs/vite/blob/v4.2.0-beta.0/p Vite 4.1 updates to the latest versions of Rollup and esbuild. Check out the new [Rollup docs](https://rollupjs.org/), that are now powered by VitePress making the navigation between Vite and Rollup docs easier for users. -[Vite docs](https://vitejs.dev) got a theme update migrating to the latest version of VitePress. +[Vite docs](https://vite.dev) got a theme update migrating to the latest version of VitePress. -As part of [Vite 4](https://vitejs.dev/blog/announcing-vite4.html), the Vue and React plugins have been extracted out of the monorepo. Although their release cycle will no longer follow Vite releases moving forward, Vite 4.1 is released in parallel with new versions of [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/releases/tag/plugin-react%403.1.0) and [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc/releases/tag/v3.1.0). @vitejs/plugin-react 3.1.0 reworks the way HMR is handled fixing many edge cases and @vitejs/plugin-react-swc 3.1.0 adds support for SWC plugins. +As part of [Vite 4](https://vite.dev/blog/announcing-vite4.html), the Vue and React plugins have been extracted out of the monorepo. Although their release cycle will no longer follow Vite releases moving forward, Vite 4.1 is released in parallel with new versions of [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/releases/tag/plugin-react%403.1.0) and [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc/releases/tag/v3.1.0). @vitejs/plugin-react 3.1.0 reworks the way HMR is handled fixing many edge cases and @vitejs/plugin-react-swc 3.1.0 adds support for SWC plugins. There is also a new major for [@vitejs/plugin-legacy](https://github.com/vitejs/vite/blob/main/packages/plugin-legacy), see [changelog for v4.0.0](https://github.com/vitejs/vite/blob/main/packages/plugin-legacy/CHANGELOG.md#400-2023-02-02). This version contains breaking changes: - Support browserslist and update default target ([#11318](https://github.com/vitejs/vite/pull/11318)). See [updated `targets` default](https://github.com/vitejs/vite/tree/main/packages/plugin-legacy#targets). @@ -1998,20 +1998,20 @@ See [4.1.0-beta.0 changelog](https://github.com/vitejs/vite/blob/v4.1.0-beta.0/p ## 4.0.0 (2022-12-09) - + -Read the announcement blog post: [Announcing Vite 4](https://vitejs.dev/blog/announcing-vite4) +Read the announcement blog post: [Announcing Vite 4](https://vite.dev/blog/announcing-vite4) Quick links: -- [Docs](https://vitejs.dev) -- [Migration Guide](https://vitejs.dev/guide/migration) +- [Docs](https://vite.dev) +- [Migration Guide](https://vite.dev/guide/migration) Docs in other languages: -- [简体中文](https://cn.vitejs.dev/) -- [日本語](https://ja.vitejs.dev/) -- [Español](https://es.vitejs.dev/) +- [简体中文](https://cn.vite.dev/) +- [日本語](https://ja.vite.dev/) +- [Español](https://es.vite.dev/) ### Main Changes @@ -2305,11 +2305,11 @@ Library mode now supports multiple entries: } // => primary.es.js, primary.cjs.js, secondary.es.js, secondary.cjs.js ``` -Check out the PR [#7047](https://github.com/vitejs/vite/issues/7047), and the [`build.lib` config docs](https://main.vitejs.dev/config/build-options.html#build-lib) +Check out the PR [#7047](https://github.com/vitejs/vite/issues/7047), and the [`build.lib` config docs](https://main.vite.dev/config/build-options.html#build-lib) #### `build.modulePreload` options -Vite now allows filtering and modifying module preload dependencies for each entry and async chunk. [`experimental.renderBuiltUrl`](https://vitejs.dev/guide/build.html#advanced-base-options) will also get called for preload asset paths. And `build.modulePreload.resolveDependencies` will be called both for JS dynamic imports preload lists and also for HTML preload lists for chunks imported from entry HTML files. Refer to the PR for more context [#9938](https://github.com/vitejs/vite/issues/9938) and check out the [modulePreload config docs](https://vitejs.dev/config/build-options.html#build-modulepreload). Note: `build.modulePreloadPolyfill` is now deprecated, please migrate to `build.modulePreload.polyfill`. +Vite now allows filtering and modifying module preload dependencies for each entry and async chunk. [`experimental.renderBuiltUrl`](https://vite.dev/guide/build.html#advanced-base-options) will also get called for preload asset paths. And `build.modulePreload.resolveDependencies` will be called both for JS dynamic imports preload lists and also for HTML preload lists for chunks imported from entry HTML files. Refer to the PR for more context [#9938](https://github.com/vitejs/vite/issues/9938) and check out the [modulePreload config docs](https://vite.dev/config/build-options.html#build-modulepreload). Note: `build.modulePreloadPolyfill` is now deprecated, please migrate to `build.modulePreload.polyfill`. #### Include Duplicate Assets in the Manifest @@ -2687,9 +2687,9 @@ See [3.1.0-beta.0 changelog](https://github.com/vitejs/vite/blob/v3.1.0-beta.0/p ### Main Changes > **Vite 3 is out!** -> Read the [Vite 3 Announcement blog post](https://vitejs.dev/blog/announcing-vite3) +> Read the [Vite 3 Announcement blog post](https://vite.dev/blog/announcing-vite3) -- New docs theme using [VitePress](https://vitepress.vuejs.org/) v1 alpha: https://vitejs.dev +- New docs theme using [VitePress](https://vitepress.vuejs.org/) v1 alpha: https://vite.dev - Vite CLI - The default dev server port is now 5173, with the preview server starting at 4173. - The default dev server host is now `localhost` instead of `127.0.0.1`. @@ -2700,21 +2700,21 @@ See [3.1.0-beta.0 changelog](https://github.com/vitejs/vite/blob/v3.1.0-beta.0/p - JS file extensions in SSR and lib mode now use a valid extension (`js`, `mjs`, or `cjs`) for output JS entries and chunks based on their format and the package type. - Architecture changes - Vite now avoids full reload during cold start when imports are injected by plugins in while crawling the initial statically imported modules ([#8869](https://github.com/vitejs/vite/issues/8869)). - - Vite uses ESM for the SSR build by default, and previous [SSR externalization heuristics](https://vitejs.dev/guide/ssr.html#ssr-externals) are no longer needed. -- `import.meta.glob` has been improved, read about the new features in the [Glob Import Guide](https://vitejs.dev/guide/features.html#glob-import) -- The WebAssembly import API has been revised to avoid collisions with future standards. Read more in the [WebAssembly guide](https://vitejs.dev/guide/features.html#webassembly) + - Vite uses ESM for the SSR build by default, and previous [SSR externalization heuristics](https://vite.dev/guide/ssr.html#ssr-externals) are no longer needed. +- `import.meta.glob` has been improved, read about the new features in the [Glob Import Guide](https://vite.dev/guide/features.html#glob-import) +- The WebAssembly import API has been revised to avoid collisions with future standards. Read more in the [WebAssembly guide](https://vite.dev/guide/features.html#webassembly) - Improved support for relative base. - Experimental Features - - [Build Advanced Base Options](https://vitejs.dev/guide/build.html#advanced-base-options) + - [Build Advanced Base Options](https://vite.dev/guide/build.html#advanced-base-options) - [HMR Partial Accept](https://github.com/vitejs/vite/pull/7324) - - Vite now allows the use of [esbuild to optimize dependencies during build time](https://vitejs.dev/guide/migration.html#using-esbuild-deps-optimization-at-build-time) avoiding the need of [`@rollup/plugin-commonjs`](https://github.com/rollup/plugins/tree/master/packages/commonjs), removing one of the difference id dependency handling between dev and prod. + - Vite now allows the use of [esbuild to optimize dependencies during build time](https://vite.dev/guide/migration.html#using-esbuild-deps-optimization-at-build-time) avoiding the need of [`@rollup/plugin-commonjs`](https://github.com/rollup/plugins/tree/master/packages/commonjs), removing one of the difference id dependency handling between dev and prod. - Bundle size reduction - Terser is now an optional dependency. If you use `build.minify: 'terser'`, you'll need to install it (`npm add -D terser`) - - node-forge moved out of the monorepo to [@vitejs/plugin-basic-ssl](https://vitejs.dev/guide/migration.html#automatic-https-certificate-generation) -- Options that were [already deprecated in v2](https://vitejs.dev/guide/migration.html#config-options-changes) have been removed. + - node-forge moved out of the monorepo to [@vitejs/plugin-basic-ssl](https://vite.dev/guide/migration.html#automatic-https-certificate-generation) +- Options that were [already deprecated in v2](https://vite.dev/guide/migration.html#config-options-changes) have been removed. > **Note** -> Before updating, check out the [migration guide from v2](https://vitejs.dev/guide/migration) +> Before updating, check out the [migration guide from v2](https://vite.dev/guide/migration) ### Features diff --git a/packages/vite/README.md b/packages/vite/README.md index 89490d7b480a8e..28fb80b9a2ae78 100644 --- a/packages/vite/README.md +++ b/packages/vite/README.md @@ -11,10 +11,10 @@ Vite (French word for "fast", pronounced `/vit/`) is a new breed of frontend build tool that significantly improves the frontend development experience. It consists of two major parts: -- A dev server that serves your source files over [native ES modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), with [rich built-in features](https://vitejs.dev/guide/features.html) and astonishingly fast [Hot Module Replacement (HMR)](https://vitejs.dev/guide/features.html#hot-module-replacement). +- A dev server that serves your source files over [native ES modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), with [rich built-in features](https://vite.dev/guide/features.html) and astonishingly fast [Hot Module Replacement (HMR)](https://vite.dev/guide/features.html#hot-module-replacement). -- A [build command](https://vitejs.dev/guide/build.html) that bundles your code with [Rollup](https://rollupjs.org), pre-configured to output highly optimized static assets for production. +- A [build command](https://vite.dev/guide/build.html) that bundles your code with [Rollup](https://rollupjs.org), pre-configured to output highly optimized static assets for production. -In addition, Vite is highly extensible via its [Plugin API](https://vitejs.dev/guide/api-plugin.html) and [JavaScript API](https://vitejs.dev/guide/api-javascript.html) with full typing support. +In addition, Vite is highly extensible via its [Plugin API](https://vite.dev/guide/api-plugin.html) and [JavaScript API](https://vite.dev/guide/api-javascript.html) with full typing support. -[Read the Docs to Learn More](https://vitejs.dev). +[Read the Docs to Learn More](https://vite.dev). diff --git a/packages/vite/index.cjs b/packages/vite/index.cjs index 39f2771e92ded6..55cff43d29e4b7 100644 --- a/packages/vite/index.cjs +++ b/packages/vite/index.cjs @@ -40,7 +40,7 @@ function warnCjsUsage() { const yellow = (str) => `\u001b[33m${str}\u001b[39m` console.warn( yellow( - `The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.`, + `The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.`, ), ) if (process.env.VITE_CJS_TRACE) { diff --git a/packages/vite/index.d.cts b/packages/vite/index.d.cts index 146c8bc289e518..a68d51e0aa7d13 100644 --- a/packages/vite/index.d.cts +++ b/packages/vite/index.d.cts @@ -1,5 +1,5 @@ /** - * @deprecated The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details. + * @deprecated The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details. */ declare const module: any diff --git a/packages/vite/src/client/client.ts b/packages/vite/src/client/client.ts index 5087e1f3801b48..c9d5a865f8b051 100644 --- a/packages/vite/src/client/client.ts +++ b/packages/vite/src/client/client.ts @@ -49,14 +49,14 @@ try { 'your current setup:\n' + ` (browser) ${currentScriptHost} <--[HTTP]--> ${serverHost} (server)\n` + ` (browser) ${socketHost} <--[WebSocket (failing)]--> ${directSocketHost} (server)\n` + - 'Check out your Vite / network configuration and https://vitejs.dev/config/server-options.html#server-hmr .', + 'Check out your Vite / network configuration and https://vite.dev/config/server-options.html#server-hmr .', ) }) socket.addEventListener( 'open', () => { console.info( - '[vite] Direct websocket connection fallback. Check out https://vitejs.dev/config/server-options.html#server-hmr to remove the previous connection error.', + '[vite] Direct websocket connection fallback. Check out https://vite.dev/config/server-options.html#server-hmr to remove the previous connection error.', ) }, { once: true }, @@ -113,7 +113,7 @@ function setupWebSocket( } function cleanUrl(pathname: string): string { - const url = new URL(pathname, 'http://vitejs.dev') + const url = new URL(pathname, 'http://vite.dev') url.searchParams.delete('direct') return url.pathname + url.search } @@ -457,7 +457,7 @@ export function injectQuery(url: string, queryToInject: string): string { // can't use pathname from URL since it may be relative like ../ const pathname = url.replace(/[?#].*$/, '') - const { search, hash } = new URL(url, 'http://vitejs.dev') + const { search, hash } = new URL(url, 'http://vite.dev') return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ''}${ hash || '' diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index 6f7efc1a4b5bc2..16d5e159a22756 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -1428,7 +1428,7 @@ export function resolveBaseUrl( // parse base when command is serve or base is not External URL if (!isBuild || !isExternal) { - base = new URL(base, 'http://vitejs.dev').pathname + base = new URL(base, 'http://vite.dev').pathname // ensure leading slash if (base[0] !== '/') { base = '/' + base @@ -1619,7 +1619,7 @@ async function bundleConfigFile( throw new Error( `Failed to resolve ${JSON.stringify( id, - )}. This package is ESM only but it was tried to load by \`require\`. See https://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only for more details.`, + )}. This package is ESM only but it was tried to load by \`require\`. See https://vite.dev/guide/troubleshooting.html#this-package-is-esm-only for more details.`, ) } } @@ -1636,7 +1636,7 @@ async function bundleConfigFile( throw new Error( `${JSON.stringify( id, - )} resolved to an ESM file. ESM file cannot be loaded by \`require\`. See https://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only for more details.`, + )} resolved to an ESM file. ESM file cannot be loaded by \`require\`. See https://vite.dev/guide/troubleshooting.html#this-package-is-esm-only for more details.`, ) } return { diff --git a/packages/vite/src/node/http.ts b/packages/vite/src/node/http.ts index 8a12179645fd23..ec1bf5e645641d 100644 --- a/packages/vite/src/node/http.ts +++ b/packages/vite/src/node/http.ts @@ -188,7 +188,7 @@ export function setClientErrorHandler( logger.warn( colors.yellow( 'Server responded with status code 431. ' + - 'See https://vitejs.dev/guide/troubleshooting.html#_431-request-header-fields-too-large.', + 'See https://vite.dev/guide/troubleshooting.html#_431-request-header-fields-too-large.', ), ) } diff --git a/packages/vite/src/node/optimizer/esbuildDepPlugin.ts b/packages/vite/src/node/optimizer/esbuildDepPlugin.ts index 4fc5a1d53b1560..d66e918432f02f 100644 --- a/packages/vite/src/node/optimizer/esbuildDepPlugin.ts +++ b/packages/vite/src/node/optimizer/esbuildDepPlugin.ts @@ -268,7 +268,7 @@ module.exports = Object.create(new Proxy({}, { key !== 'constructor' && key !== 'splice' ) { - console.warn(\`Module "${path}" has been externalized for browser compatibility. Cannot access "${path}.\${key}" in client code. See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.\`) + console.warn(\`Module "${path}" has been externalized for browser compatibility. Cannot access "${path}.\${key}" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.\`) } } }))`, diff --git a/packages/vite/src/node/plugins/importAnalysis.ts b/packages/vite/src/node/plugins/importAnalysis.ts index 32591fda93f2d3..1e317c23515ffe 100644 --- a/packages/vite/src/node/plugins/importAnalysis.ts +++ b/packages/vite/src/node/plugins/importAnalysis.ts @@ -1042,7 +1042,7 @@ function __vite__injectQuery(url: string, queryToInject: string): string { // can't use pathname from URL since it may be relative like ../ const pathname = url.replace(/[?#].*$/, '') - const { search, hash } = new URL(url, 'http://vitejs.dev') + const { search, hash } = new URL(url, 'http://vite.dev') return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ''}${ hash || '' diff --git a/packages/vite/src/node/plugins/importMetaGlob.ts b/packages/vite/src/node/plugins/importMetaGlob.ts index 991393f5aa6b54..d681181c5ff0a4 100644 --- a/packages/vite/src/node/plugins/importMetaGlob.ts +++ b/packages/vite/src/node/plugins/importMetaGlob.ts @@ -602,6 +602,6 @@ export function getCommonBase(globsResolved: string[]): null | string { } export function isVirtualModule(id: string): boolean { - // https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention + // https://vite.dev/guide/api-plugin.html#virtual-modules-convention return id.startsWith('virtual:') || id[0] === '\0' || !id.includes('/') } diff --git a/packages/vite/src/node/plugins/resolve.ts b/packages/vite/src/node/plugins/resolve.ts index f740981ba1ef21..b206a2fa1d6e7c 100644 --- a/packages/vite/src/node/plugins/resolve.ts +++ b/packages/vite/src/node/plugins/resolve.ts @@ -490,7 +490,7 @@ export function resolvePlugin( } else if (isProduction) { this.warn( `Module "${id}" has been externalized for browser compatibility, imported by "${importer}". ` + - `See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.`, + `See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.`, ) } return isProduction @@ -512,7 +512,7 @@ export function resolvePlugin( return `\ export default new Proxy({}, { get(_, key) { - throw new Error(\`Module "${id}" has been externalized for browser compatibility. Cannot access "${id}.\${key}" in client code. See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.\`) + throw new Error(\`Module "${id}" has been externalized for browser compatibility. Cannot access "${id}.\${key}" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.\`) } })` } diff --git a/packages/vite/src/node/plugins/wasm.ts b/packages/vite/src/node/plugins/wasm.ts index 0fbb2b90d65205..ea0b45a4c68a51 100644 --- a/packages/vite/src/node/plugins/wasm.ts +++ b/packages/vite/src/node/plugins/wasm.ts @@ -88,7 +88,7 @@ export const wasmFallbackPlugin = (): Plugin => { '"ESM integration proposal for Wasm" is not supported currently. ' + 'Use vite-plugin-wasm or other community plugins to handle this. ' + 'Alternatively, you can use `.wasm?init` or `.wasm?url`. ' + - 'See https://vitejs.dev/guide/features.html#webassembly for more details.', + 'See https://vite.dev/guide/features.html#webassembly for more details.', ) }, } diff --git a/packages/vite/src/node/server/middlewares/static.ts b/packages/vite/src/node/server/middlewares/static.ts index e7e260c97325e6..8dc4616996aeae 100644 --- a/packages/vite/src/node/server/middlewares/static.ts +++ b/packages/vite/src/node/server/middlewares/static.ts @@ -273,7 +273,7 @@ export function ensureServingAccess( const hintMessage = ` ${server.config.server.fs.allow.map((i) => `- ${i}`).join('\n')} -Refer to docs https://vitejs.dev/config/server-options.html#server-fs-allow for configurations and more details.` +Refer to docs https://vite.dev/config/server-options.html#server-fs-allow for configurations and more details.` server.config.logger.error(urlMessage) server.config.logger.warnOnce(hintMessage + '\n') diff --git a/playground/assets/index.html b/playground/assets/index.html index 17858c6692d82d..e010c9c92a19ac 100644 --- a/playground/assets/index.html +++ b/playground/assets/index.html @@ -178,7 +178,7 @@Image Src Set
