You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/migration.md
+9-14
Original file line number
Diff line number
Diff line change
@@ -31,26 +31,12 @@ A small fraction of users will now require using [@vitejs/plugin-legacy](https:/
31
31
32
32
This section describes the biggest architecture changes in Vite v3. To allow projects to migrate from v2 in case of a compat issue, legacy options have been added to revert to the Vite v2 strategies.
33
33
34
-
:::warning
35
-
These options are marked as experimental and deprecated. They may be removed in a future v3 minor without respecting semver. Please pin the Vite version when using them.
36
-
37
-
-`legacy.buildRollupPluginCommonjs`
38
-
-`legacy.buildSsrCjsExternalHeuristics`
39
-
40
-
:::
41
-
42
34
### Dev Server Changes
43
35
44
36
Vite's default dev server port is now 5173. You can use [`server.port`](../config/server-options.md#server-port) to set it to 3000.
45
37
46
38
Vite's default dev server host is now `localhost`. You can use [`server.host`](../config/server-options.md#server-host) to set it to `127.0.0.1`.
47
39
48
-
### Build Changes
49
-
50
-
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.
51
-
52
-
If you need to get back to the v2 strategy, you can use `legacy.buildRollupPluginCommonjs`.
53
-
54
40
### SSR Changes
55
41
56
42
Vite v3 uses ESM for the SSR build by default. When using ESM, the [SSR externalization heuristics](https://vitejs.dev/guide/ssr.html#ssr-externals) are no longer needed. By default, all dependencies are externalized. You can use [`ssr.noExternal`](../config/ssr-options.md#ssr-noexternal) to control what dependencies to include in the SSR bundle.
@@ -114,6 +100,15 @@ export default {
114
100
}
115
101
```
116
102
103
+
## Experimental
104
+
105
+
### Using esbuild deps optimization at build time
106
+
107
+
In v3, Vite allows the use of esbuild to optimize dependencies during build time. If enabled, it removes one of the most significant differences between dev and prod present in v2. [`@rollupjs/plugin-commonjs`](https://github.com/rollup/plugins/tree/master/packages/commonjs) is no longer needed in this case since esbuild converts CJS-only dependencies to ESM.
108
+
109
+
If you want to try this build strategy, you can use `optimizeDeps.disabled: false` (the default in v3 is `disabled: 'build'`). `@rollup/plugin-commonjs`
110
+
can be removed by passing `build.commonjsOptions: { include: [] }`
111
+
117
112
## Advanced
118
113
119
114
There are some changes which only affects plugin/tool creators.
Copy file name to clipboardExpand all lines: packages/vite/CHANGELOG.md
+11
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,14 @@
1
+
## 3.0.0-beta.8 (2022-07-08)
2
+
3
+
* refactor: opt-in optimizeDeps during build and SSR (#8965) ([f8c8cf2](https://github.com/vitejs/vite/commit/f8c8cf2)), closes [#8965](https://github.com/vitejs/vite/issues/8965)
0 commit comments