diff --git a/docs/guide/migration.md b/docs/guide/migration.md index 6021f3c26c1e40..78b738afb82ddf 100644 --- a/docs/guide/migration.md +++ b/docs/guide/migration.md @@ -24,7 +24,7 @@ A small fraction of users will now require using [@vitejs/plugin-legacy](https:/ - `build.base` (switch to [`base`](../config/shared-options.md#base)) - `build.brotliSize` (switch to [`build.reportCompressedSize`](../config/build-options.md#build-reportcompressedsize)) - `build.cleanCssOptions` (Vite now uses esbuild for CSS minification) - - `build.polyfillDynamicImport` (use [`@vitejs/plugin-legacy](https://github.com/vitejs/vite/tree/main/packages/plugin-legacy) for browsers without dynamic import support) + - `build.polyfillDynamicImport` (use [`@vitejs/plugin-legacy`](https://github.com/vitejs/vite/tree/main/packages/plugin-legacy) for browsers without dynamic import support) - `optimizeDeps.keepNames` (switch to [`optimizeDeps.esbuildOptions.keepNames`](../config/dep-optimization-options.md#optimizedepsesbuildoptions)) ## Dev Server Changes @@ -37,7 +37,7 @@ To get back the v2 strategy, you can use [`optimizeDeps.devScan`](../config/dep- ## Build Changes -In v3, Vite uses esbuild to optimize dependencies by default. Doing so, it removes one of the most significant differences between dev and prod present in v2. Because esbuild converts CJS-only dependencies to ESM, [`@rollupjs/plugin-commonjs`] is no longer used. +In v3, Vite uses esbuild to optimize dependencies by default. Doing so, it removes one of the most significant differences between dev and prod present in v2. Because esbuild converts CJS-only dependencies to ESM, [`@rollupjs/plugin-commonjs`](https://github.com/rollup/plugins/tree/master/packages/commonjs) is no longer used. If you need to get back to the v2 strategy, you can use [`optimizeDeps.disabled: 'build'`](../config/dep-optimization-options.md#optimizedepsdisabled). @@ -85,6 +85,29 @@ You can use `?init` which is similar to the previous behavior. }) ``` +## Advanced + +There are some changes which only affects plugin/tool creators. + +- [[#5868] refactor: remove deprecated api for 3.0](https://github.com/vitejs/vite/pull/5868) + - `printHttpServerUrls` is removed + - `server.app`, `server.transformWithEsbuild` are removed + - `import.meta.hot.acceptDeps` is removed +- [[#7995] chore: do not fixStacktrace](https://github.com/vitejs/vite/pull/7995) + - `ssrLoadModule`'s `fixStacktrace` option's default is now `false` +- [[#8178] feat!: migrate to ESM](https://github.com/vitejs/vite/pull/8178) + - `formatPostcssSourceMap` is now async + - `resolvePackageEntry`, `resolvePackageData` are no longer available from CJS build (dynamic import is needed to use in CJS) + +Also there are other breaking changes which only affect few users. + +- [[#5018] feat: enable `generatedCode: 'es2015'` for rollup build](https://github.com/vitejs/vite/pull/5018) + - Transpile to ES5 is now necessary even if the user code only includes ES5. +- [[#7877] fix: vite client types](https://github.com/vitejs/vite/pull/7877) + - `/// ` is removed from `vite/client.d.ts`. `{ "lib": ["dom"] }` or `{ "lib": ["webworker"] }` is necessary in `tsconfig.json`. +- [[#8280] feat: non-blocking esbuild optimization at build time](https://github.com/vitejs/vite/pull/8280) + - `server.force` option was removed in favor of `force` option. + ## Migration from v1 Check the [Migration from v1 Guide](https://v2.vitejs.dev/guide/migration.html) in the Vite v2 docs first to see the needed changes to port your app to Vite v2, and then proceed with the changes on this page.