@servicetitan/docs-uikit 36.1.1-beta.1 → 36.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,90 +0,0 @@
1
- ---
2
- title: Vite
3
- ---
4
-
5
- ✨ New in **[INSERT-VERSION-HERE]** ✨
6
-
7
- Vite is an alternative dev server for `startup start`, enabled with the `--use-vite` flag.
8
-
9
- ```sh
10
- npx startup start --use-vite
11
- ```
12
-
13
- :::tip
14
- For build-time configuration (minification, plugin overrides, custom templates), see [Vite build](../build/vite).
15
- :::
16
-
17
- ## Server Options
18
-
19
- ### Port {#port}
20
-
21
- Use `cli.vite.port` to select the port for the dev server. Default: 8080 for applications, 8888 for MFEs.
22
-
23
- ```json title="package.json"
24
- {
25
- "cli": {
26
- "vite": {
27
- "port": 3000
28
- }
29
- }
30
- }
31
- ```
32
-
33
- ### Proxy
34
-
35
- Configure a dev server proxy in `vite.dev.config.ts`:
36
-
37
- ```ts title="vite.dev.config.ts"
38
- import { defineConfig } from '@servicetitan/startup/vite';
39
-
40
- export default defineConfig({
41
- config: {
42
- server: {
43
- proxy: {
44
- '/api': {
45
- target: 'http://localhost:3000',
46
- changeOrigin: true,
47
- },
48
- },
49
- },
50
- },
51
- });
52
- ```
53
-
54
- For advanced use cases like request interception, use the `configure` callback:
55
-
56
- ```ts title="vite.dev.config.ts"
57
- import { defineConfig } from '@servicetitan/startup/vite';
58
-
59
- export default defineConfig({
60
- config: {
61
- server: {
62
- proxy: {
63
- '/api': {
64
- target: 'http://localhost:3000',
65
- configure: proxy => {
66
- proxy.on('proxyReq', (proxyReq, req) => {
67
- proxyReq.setHeader('X-Custom-Header', 'value');
68
- });
69
- },
70
- },
71
- },
72
- },
73
- },
74
- });
75
- ```
76
-
77
- See [Vite server.proxy](https://vite.dev/config/server-options#server-proxy) for the full list of options.
78
-
79
- ## Hot Module Replacement
80
-
81
- Vite provides fast HMR out of the box. CSS changes are applied instantly without a full page reload.
82
-
83
- For MFEs running in shadow DOM, CSS HMR uses `adoptedStyleSheets`. Style updates are applied to the shadow root automatically without affecting the host page.
84
-
85
- ## Not Yet Supported
86
-
87
- The following webpack dev server features are not yet available with Vite:
88
-
89
- - `--code-coverage`: code instrumentation for coverage
90
- - `cli.webpack.devServer: false` equivalent: disabling the dev server to use file watching + rebuild to disk instead.
@@ -1,39 +0,0 @@
1
- ---
2
- title: Webpack
3
- ---
4
-
5
- Webpack is the default bundler for `startup start`.
6
-
7
- ## Port {#port}
8
-
9
- Use `cli.webpack.port` to select the port to use for a package. By default, packages are served from the first available port starting from 8080.
10
-
11
- ```json title="package.json"
12
- {
13
- "cli": {
14
- "webpack": {
15
- "port": 8888
16
- }
17
- }
18
- }
19
- ```
20
-
21
- ## DevServer
22
-
23
- Use `cli.webpack.devServer` to set or override `webpack-dev-server` options.
24
-
25
- ```json title="package.json"
26
- {
27
- "cli": {
28
- "webpack": {
29
- "devServer": {
30
- // webpack-dev-server options (https://webpack.js.org/configuration/dev-server/#devserver)
31
- }
32
- }
33
- }
34
- }
35
- ```
36
-
37
- :::tip
38
- Set `cli.webpack.devServer` to `false` to disable `webpack-dev-server` altogether.
39
- :::