|
33 | 33 |
|
34 | 34 | #### Bundler Build Feature Flags
|
35 | 35 |
|
36 |
| -Starting with 3.0.0-rc.3, `esm-bundler` builds now exposes global feature flags that can be overwritten at compile time: |
| 36 | +[Detailed Reference on vuejs.org](https://vuejs.org/api/compile-time-flags.html) |
37 | 37 |
|
38 |
| -- `__VUE_OPTIONS_API__` (enable/disable Options API support, default: `true`) |
39 |
| -- `__VUE_PROD_DEVTOOLS__` (enable/disable devtools support in production, default: `false`) |
40 |
| -- `__VUE_PROD_HYDRATION_MISMATCH_DETAILS__` (enable/disable detailed warnings for hydration mismatches in production, default: `false`) |
| 38 | +`esm-bundler` builds of Vue expose global feature flags that can be overwritten at compile time: |
41 | 39 |
|
42 |
| -The build will work without configuring these flags, however it is **strongly recommended** to properly configure them in order to get proper tree-shaking in the final bundle. To configure these flags: |
| 40 | +- `__VUE_OPTIONS_API__` |
| 41 | + - Default: `true` |
| 42 | + - Enable / disable Options API support |
43 | 43 |
|
44 |
| -- webpack: use [DefinePlugin](https://webpack.js.org/plugins/define-plugin/) |
45 |
| -- Rollup: use [@rollup/plugin-replace](https://github.com/rollup/plugins/tree/master/packages/replace) |
46 |
| -- Vite: configured by default, but can be overwritten using the [`define` option](https://github.com/vitejs/vite/blob/a4133c073e640b17276b2de6e91a6857bdf382e1/src/node/config.ts#L72-L76) |
| 44 | +- `__VUE_PROD_DEVTOOLS__` |
| 45 | + - Default: `false` |
| 46 | + - Enable / disable devtools support in production |
47 | 47 |
|
48 |
| -Note: the replacement value **must be boolean literals** and cannot be strings, otherwise the bundler/minifier will not be able to properly evaluate the conditions. |
| 48 | +- `__VUE_PROD_HYDRATION_MISMATCH_DETAILS__` |
| 49 | + - Default: `false` |
| 50 | + - Enable / disable detailed warnings for hydration mismatches in production |
| 51 | + |
| 52 | +The build will work without configuring these flags, however it is **strongly recommended** to properly configure them in order to get proper tree-shaking in the final bundle. |
49 | 53 |
|
50 | 54 | ### For Server-Side Rendering
|
51 | 55 |
|
|
0 commit comments