diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5a1ccb1c3b836..ed1cee5c4ede04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,7 @@ jobs: uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Set node version to ${{ matrix.node_version }} - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: node-version: ${{ matrix.node_version }} cache: "pnpm" @@ -160,7 +160,7 @@ jobs: uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Set node version to 24 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: node-version: 24 cache: "pnpm" diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 8873aa41ffdce9..4b43e7edf8f9b5 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -22,7 +22,7 @@ jobs: uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Set node version to 24 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: node-version: 24 cache: "pnpm" diff --git a/.github/workflows/preview-release.yml b/.github/workflows/preview-release.yml index 8839daecbefed6..8051e4e86eddfd 100644 --- a/.github/workflows/preview-release.yml +++ b/.github/workflows/preview-release.yml @@ -31,7 +31,7 @@ jobs: uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Set node version to 24 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: node-version: 24 registry-url: https://registry.npmjs.org/ diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4667d2528c047d..a08e6ed177ca7c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,7 +26,7 @@ jobs: uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 - name: Set node version to 24 - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: node-version: 24 registry-url: https://registry.npmjs.org/ diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index f0e7da8131163a..df6405e2532e91 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -12,7 +12,7 @@ import { markdownItImageSize } from 'markdown-it-image-size' import { extendConfig } from '@voidzero-dev/vitepress-theme/config' import type { FooterLink } from '@voidzero-dev/vitepress-theme' import packageJson from '../../packages/vite/package.json' with { type: 'json' } -import { buildEnd } from './buildEnd.config' +import { buildEnd } from './buildEnd.config.ts' const viteVersion = packageJson.version const viteMajorVersion = +viteVersion.split('.')[0] diff --git a/docs/guide/performance.md b/docs/guide/performance.md index b738dd10d7a2bf..ea735bbeaed336 100644 --- a/docs/guide/performance.md +++ b/docs/guide/performance.md @@ -18,7 +18,7 @@ Vite's internal and official plugins are optimized to do the least amount of wor However, the performance of community plugins is out of Vite's control, which may affect the developer experience. Here are a few things you can look out for when using additional Vite plugins: -1. Large dependencies that are only used in certain cases should be dynamically imported to reduce the Node.js startup time. Example refactors: [vite-plugin-react#212](https://github.com/vitejs/vite-plugin-react/pull/212) and [vite-plugin-pwa#224](https://github.com/vite-pwa/vite-plugin-pwa/pull/244). +1. Large dependencies that are only used in certain cases should be dynamically imported to reduce the Node.js startup time. Example refactors: [vite-plugin-react#212](https://github.com/vitejs/vite-plugin-react/pull/212) and [vite-plugin-pwa#244](https://github.com/vite-pwa/vite-plugin-pwa/pull/244). 2. The `buildStart`, `config`, and `configResolved` hooks should not run long and extensive operations. These hooks are awaited during dev server startup, which delays when you can access the site in the browser. diff --git a/docs/guide/static-deploy-github-pages.yaml b/docs/guide/static-deploy-github-pages.yaml index 88217826624295..5a9ba26c5266f0 100644 --- a/docs/guide/static-deploy-github-pages.yaml +++ b/docs/guide/static-deploy-github-pages.yaml @@ -35,7 +35,7 @@ jobs: - name: Checkout uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 - name: Set up Node - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 with: node-version: lts/* cache: 'npm' diff --git a/docs/guide/static-deploy.md b/docs/guide/static-deploy.md index ca076061a51aea..4b2992fe3abc63 100644 --- a/docs/guide/static-deploy.md +++ b/docs/guide/static-deploy.md @@ -213,7 +213,7 @@ Cloudflare Pages gives you a way to deploy directly to Cloudflare without having After your project has been imported and deployed, all subsequent pushes to branches will generate [Preview Deployments](https://developers.cloudflare.com/pages/platform/preview-deployments/) unless specified not to in your [branch build controls](https://developers.cloudflare.com/pages/platform/branch-build-controls/). All changes to the Production Branch (commonly "main") will result in a Production Deployment. -You can also add custom domains and handle custom build settings on Pages. Learn more about [Cloudflare Pages Git Integration](https://developers.cloudflare.com/pages/get-started/#manage-your-site). +You can also add custom domains and handle custom build settings on Pages. Learn more about [Cloudflare Pages Git Integration](https://developers.cloudflare.com/pages/configuration/git-integration/). ## Google Firebase @@ -288,7 +288,7 @@ You can deploy your Vite app as a Static Site on [Render](https://render.com/). 5. Click **Create Static Site**. Your app should be deployed at `https://.onrender.com/`. -By default, any new commit pushed to the specified branch will automatically trigger a new deployment. [Auto-Deploy](https://render.com/docs/deploys#toggling-auto-deploy-for-a-service) can be configured in the project settings. +By default, any new commit pushed to the specified branch will automatically trigger a new deployment. [Auto-Deploy](https://render.com/docs/deploys#configuring-auto-deploys) can be configured in the project settings. You can also add a [custom domain](https://render.com/docs/custom-domains) to your project. diff --git a/docs/guide/troubleshooting.md b/docs/guide/troubleshooting.md index fd70a46cd197f4..aed5bf241c4bd9 100644 --- a/docs/guide/troubleshooting.md +++ b/docs/guide/troubleshooting.md @@ -218,7 +218,7 @@ It might be possible to work around by selecting a different chunk name by [`bui ### Outdated pre-bundled deps when linking to a local package -The hash key used to invalidate optimized dependencies depends on the package lock contents, the patches applied to dependencies, and the options in the Vite config file that affects the bundling of node modules. This means that Vite will detect when a dependency is overridden using a feature as [npm overrides](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides), and re-bundle your dependencies on the next server start. Vite won't invalidate the dependencies when you use a feature like [npm link](https://docs.npmjs.com/cli/v9/commands/npm-link). In case you link or unlink a dependency, you'll need to force re-optimization on the next server start by using `vite --force`. We recommend using overrides instead, which are supported now by every package manager (see also [pnpm overrides](https://pnpm.io/9.x/package_json#pnpmoverrides) and [yarn resolutions](https://yarnpkg.com/configuration/manifest/#resolutions)). +The hash key used to invalidate optimized dependencies depends on the package lock contents, the patches applied to dependencies, and the options in the Vite config file that affects the bundling of node modules. This means that Vite will detect when a dependency is overridden using a feature as [npm overrides](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides), and re-bundle your dependencies on the next server start. Vite won't invalidate the dependencies when you use a feature like [npm link](https://docs.npmjs.com/cli/v9/commands/npm-link). In case you link or unlink a dependency, you'll need to force re-optimization on the next server start by using `vite --force`. We recommend using overrides instead, which are supported now by every package manager (see also [pnpm overrides](https://pnpm.io/settings#overrides) and [yarn resolutions](https://yarnpkg.com/configuration/manifest/#resolutions)). ## Performance Bottlenecks diff --git a/packages/vite/src/node/__tests__/utils.spec.ts b/packages/vite/src/node/__tests__/utils.spec.ts index fec7d1a09b9cfc..944b8bcc5f1667 100644 --- a/packages/vite/src/node/__tests__/utils.spec.ts +++ b/packages/vite/src/node/__tests__/utils.spec.ts @@ -336,7 +336,9 @@ foo() expect('\n' + value + '\n').toMatchSnapshot() } catch (e) { // don't include this function in stacktrace - Error.captureStackTrace(e, expectSnapshot) + if (e instanceof Error) { + Error.captureStackTrace(e, expectSnapshot) + } throw e } }