vite 8.1.4 → 8.2.0-beta.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.
- package/LICENSE.md +35 -0
- package/dist/client/bundledDevClient.mjs +1455 -0
- package/dist/client/client.mjs +52 -83
- package/dist/node/chunks/build.js +64 -27
- package/dist/node/chunks/moduleRunnerTransport.d.ts +25 -26
- package/dist/node/chunks/node.js +1145 -337
- package/dist/node/chunks/postcss-import.js +10 -10
- package/dist/node/index.d.ts +1334 -1294
- package/dist/node/module-runner.d.ts +76 -77
- package/dist/node/module-runner.js +18 -14
- package/package.json +14 -14
- package/types/customEvent.d.ts +1 -1
- package/types/hmrPayload.d.ts +20 -6
package/dist/node/index.d.ts
CHANGED
|
@@ -24,14 +24,13 @@ import { ZlibOptions } from "node:zlib";
|
|
|
24
24
|
import { ChunkMetadata, CustomPluginOptionsVite } from "#types/metadata";
|
|
25
25
|
import { Terser, TerserMinifyOptions } from "#types/internal/terserOptions";
|
|
26
26
|
import * as PostCSS from "postcss";
|
|
27
|
+
import { ProcessOptions, Processor, Transformer } from "postcss";
|
|
27
28
|
import { LightningCSSOptions, LightningCSSOptions as lightningcssOptions_LightningCSSOptions } from "#types/internal/lightningcssOptions";
|
|
28
29
|
import { LessPreprocessorBaseOptions, SassModernPreprocessBaseOptions, StylusPreprocessorBaseOptions } from "#types/internal/cssPreprocessorOptions";
|
|
29
30
|
import { withFilter } from "rolldown/filter";
|
|
30
31
|
import { GeneralImportGlobOptions, ImportGlobFunction, ImportGlobOptions, KnownAsTypeMap, KnownQueryTypeMap } from "#types/importGlob";
|
|
31
|
-
|
|
32
|
-
//#region \0rolldown/runtime.js
|
|
33
32
|
//#endregion
|
|
34
|
-
//#region ../../node_modules/.pnpm/@vitejs+devtools@0.
|
|
33
|
+
//#region ../../node_modules/.pnpm/@vitejs+devtools@0.4.1_crossws@0.4.10_srvx@0.11.15_typescript@6.0.3_valibot@1.4.2_vite@packages+vite/node_modules/@vitejs/devtools/dist/cli-commands.d.ts
|
|
35
34
|
//#region src/node/cli-commands.d.ts
|
|
36
35
|
interface StartOptions {
|
|
37
36
|
root?: string;
|
|
@@ -41,7 +40,7 @@ interface StartOptions {
|
|
|
41
40
|
open?: boolean;
|
|
42
41
|
}
|
|
43
42
|
//#endregion
|
|
44
|
-
//#region ../../node_modules/.pnpm/@vitejs+devtools@0.
|
|
43
|
+
//#region ../../node_modules/.pnpm/@vitejs+devtools@0.4.1_crossws@0.4.10_srvx@0.11.15_typescript@6.0.3_valibot@1.4.2_vite@packages+vite/node_modules/@vitejs/devtools/dist/config.d.ts
|
|
45
44
|
//#region src/node/config.d.ts
|
|
46
45
|
interface DevToolsConfig extends Partial<StartOptions> {
|
|
47
46
|
enabled: boolean;
|
|
@@ -425,7 +424,7 @@ interface ServerOptions$3 {
|
|
|
425
424
|
ca?: string;
|
|
426
425
|
/** Optional fetch implementation to use instead of global fetch, use this to activate fetch-based proxying,
|
|
427
426
|
* for example to proxy HTTP/2 requests
|
|
428
|
-
|
|
427
|
+
*/
|
|
429
428
|
fetch?: typeof fetch;
|
|
430
429
|
/** Optional configuration object for fetch-based proxy requests.
|
|
431
430
|
* Use this to customize fetch request and response handling.
|
|
@@ -548,22 +547,22 @@ declare function createProxyServer<TIncomingMessage extends typeof http.Incoming
|
|
|
548
547
|
//#region src/node/server/middlewares/proxy.d.ts
|
|
549
548
|
interface ProxyOptions extends ServerOptions$3 {
|
|
550
549
|
/**
|
|
551
|
-
|
|
552
|
-
|
|
550
|
+
* rewrite path
|
|
551
|
+
*/
|
|
553
552
|
rewrite?: (path: string) => string;
|
|
554
553
|
/**
|
|
555
|
-
|
|
556
|
-
|
|
554
|
+
* configure the proxy server (e.g. listen to events)
|
|
555
|
+
*/
|
|
557
556
|
configure?: (proxy: ProxyServer, options: ProxyOptions) => void;
|
|
558
557
|
/**
|
|
559
|
-
|
|
560
|
-
|
|
558
|
+
* webpack-dev-server style bypass function
|
|
559
|
+
*/
|
|
561
560
|
bypass?: (req: http.IncomingMessage, res: http.ServerResponse | undefined, options: ProxyOptions) => void | null | undefined | false | string | Promise<void | null | undefined | boolean | string>;
|
|
562
561
|
/**
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
562
|
+
* rewrite the Origin header of a WebSocket request to match the target
|
|
563
|
+
*
|
|
564
|
+
* **Exercise caution as rewriting the Origin can leave the proxying open to [CSRF attacks](https://owasp.org/www-community/attacks/csrf).**
|
|
565
|
+
*/
|
|
567
566
|
rewriteWsOrigin?: boolean | undefined;
|
|
568
567
|
}
|
|
569
568
|
//#endregion
|
|
@@ -598,92 +597,92 @@ declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger
|
|
|
598
597
|
//#region src/node/http.d.ts
|
|
599
598
|
interface CommonServerOptions {
|
|
600
599
|
/**
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
600
|
+
* Specify server port. Note if the port is already being used, Vite will
|
|
601
|
+
* automatically try the next available port so this may not be the actual
|
|
602
|
+
* port the server ends up listening on.
|
|
603
|
+
*/
|
|
605
604
|
port?: number;
|
|
606
605
|
/**
|
|
607
|
-
|
|
608
|
-
|
|
606
|
+
* If enabled, vite will exit if specified port is already in use
|
|
607
|
+
*/
|
|
609
608
|
strictPort?: boolean;
|
|
610
609
|
/**
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
610
|
+
* Specify which IP addresses the server should listen on.
|
|
611
|
+
* Set to 0.0.0.0 to listen on all addresses, including LAN and public addresses.
|
|
612
|
+
*/
|
|
614
613
|
host?: string | boolean;
|
|
615
614
|
/**
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
615
|
+
* The hostnames that Vite is allowed to respond to.
|
|
616
|
+
* `localhost` and subdomains under `.localhost` and all IP addresses are allowed by default.
|
|
617
|
+
* When using HTTPS, this check is skipped.
|
|
618
|
+
*
|
|
619
|
+
* If a string starts with `.`, it will allow that hostname without the `.` and all subdomains under the hostname.
|
|
620
|
+
* For example, `.example.com` will allow `example.com`, `foo.example.com`, and `foo.bar.example.com`.
|
|
621
|
+
*
|
|
622
|
+
* If set to `true`, the server is allowed to respond to requests for any hosts.
|
|
623
|
+
* This is not recommended as it will be vulnerable to DNS rebinding attacks.
|
|
624
|
+
*/
|
|
626
625
|
allowedHosts?: string[] | true;
|
|
627
626
|
/**
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
627
|
+
* Enable TLS + HTTP/2.
|
|
628
|
+
* Note: this downgrades to TLS only when the proxy option is also used.
|
|
629
|
+
*/
|
|
631
630
|
https?: HttpsServerOptions;
|
|
632
631
|
/**
|
|
633
|
-
|
|
634
|
-
|
|
632
|
+
* Open browser window on startup
|
|
633
|
+
*/
|
|
635
634
|
open?: boolean | string;
|
|
636
635
|
/**
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
636
|
+
* Configure custom proxy rules for the dev server. Expects an object
|
|
637
|
+
* of `{ key: options }` pairs.
|
|
638
|
+
* Uses [`http-proxy-3`](https://github.com/sagemathinc/http-proxy-3).
|
|
639
|
+
* Full options [here](https://github.com/sagemathinc/http-proxy-3#options).
|
|
640
|
+
*
|
|
641
|
+
* Example `vite.config.js`:
|
|
642
|
+
* ``` js
|
|
643
|
+
* module.exports = {
|
|
644
|
+
* proxy: {
|
|
645
|
+
* // string shorthand: /foo -> http://localhost:4567/foo
|
|
646
|
+
* '/foo': 'http://localhost:4567',
|
|
647
|
+
* // with options
|
|
648
|
+
* '/api': {
|
|
649
|
+
* target: 'http://jsonplaceholder.typicode.com',
|
|
650
|
+
* changeOrigin: true,
|
|
651
|
+
* rewrite: path => path.replace(/^\/api/, '')
|
|
652
|
+
* }
|
|
653
|
+
* }
|
|
654
|
+
* }
|
|
655
|
+
* ```
|
|
656
|
+
*/
|
|
658
657
|
proxy?: Record<string, string | ProxyOptions>;
|
|
659
658
|
/**
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
659
|
+
* Configure CORS for the dev server.
|
|
660
|
+
* Uses https://github.com/expressjs/cors.
|
|
661
|
+
*
|
|
662
|
+
* When enabling this option, **we recommend setting a specific value
|
|
663
|
+
* rather than `true`** to avoid exposing the source code to untrusted origins.
|
|
664
|
+
*
|
|
665
|
+
* Set to `true` to allow all methods from any origin, or configure separately
|
|
666
|
+
* using an object.
|
|
667
|
+
*
|
|
668
|
+
* @default { origin: /^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/ }
|
|
669
|
+
*/
|
|
671
670
|
cors?: CorsOptions | boolean;
|
|
672
671
|
/**
|
|
673
|
-
|
|
674
|
-
|
|
672
|
+
* Specify server response headers.
|
|
673
|
+
*/
|
|
675
674
|
headers?: OutgoingHttpHeaders;
|
|
676
675
|
}
|
|
677
676
|
/**
|
|
678
|
-
* https://github.com/expressjs/cors#configuration-options
|
|
679
|
-
*/
|
|
677
|
+
* https://github.com/expressjs/cors#configuration-options
|
|
678
|
+
*/
|
|
680
679
|
interface CorsOptions {
|
|
681
680
|
/**
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
681
|
+
* Configures the Access-Control-Allow-Origin CORS header.
|
|
682
|
+
*
|
|
683
|
+
* **We recommend setting a specific value rather than
|
|
684
|
+
* `true`** to avoid exposing the source code to untrusted origins.
|
|
685
|
+
*/
|
|
687
686
|
origin?: CorsOrigin | ((origin: string | undefined, cb: (err: Error, origins: CorsOrigin) => void) => void);
|
|
688
687
|
methods?: string | string[];
|
|
689
688
|
allowedHeaders?: string | string[];
|
|
@@ -715,57 +714,57 @@ interface PreviewOptions extends CommonServerOptions {}
|
|
|
715
714
|
interface ResolvedPreviewOptions extends RequiredExceptFor<PreviewOptions, "host" | "https" | "proxy"> {}
|
|
716
715
|
interface PreviewServer {
|
|
717
716
|
/**
|
|
718
|
-
|
|
719
|
-
|
|
717
|
+
* The resolved vite config object
|
|
718
|
+
*/
|
|
720
719
|
config: ResolvedConfig;
|
|
721
720
|
/**
|
|
722
|
-
|
|
723
|
-
|
|
721
|
+
* Stop the server.
|
|
722
|
+
*/
|
|
724
723
|
close(): Promise<void>;
|
|
725
724
|
/**
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
725
|
+
* A connect app instance.
|
|
726
|
+
* - Can be used to attach custom middlewares to the preview server.
|
|
727
|
+
* - Can also be used as the handler function of a custom http server
|
|
728
|
+
* or as a middleware in any connect-style Node.js frameworks
|
|
729
|
+
*
|
|
730
|
+
* https://github.com/senchalabs/connect#use-middleware
|
|
731
|
+
*/
|
|
733
732
|
middlewares: Connect.Server;
|
|
734
733
|
/**
|
|
735
|
-
|
|
736
|
-
|
|
734
|
+
* native Node http server instance
|
|
735
|
+
*/
|
|
737
736
|
httpServer: HttpServer;
|
|
738
737
|
/**
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
738
|
+
* The resolved urls Vite prints on the CLI (URL-encoded). Returns `null`
|
|
739
|
+
* if the server is not listening on any port.
|
|
740
|
+
*/
|
|
742
741
|
resolvedUrls: ResolvedServerUrls | null;
|
|
743
742
|
/**
|
|
744
|
-
|
|
745
|
-
|
|
743
|
+
* Print server urls
|
|
744
|
+
*/
|
|
746
745
|
printUrls(): void;
|
|
747
746
|
/**
|
|
748
|
-
|
|
749
|
-
|
|
747
|
+
* Bind CLI shortcuts
|
|
748
|
+
*/
|
|
750
749
|
bindCLIShortcuts(options?: BindCLIShortcutsOptions<PreviewServer>): void;
|
|
751
750
|
}
|
|
752
751
|
type PreviewServerHook = (this: MinimalPluginContextWithoutEnvironment, server: PreviewServer) => (() => void) | void | Promise<(() => void) | void>;
|
|
753
752
|
/**
|
|
754
|
-
* Starts the Vite server in preview mode, to simulate a production deployment
|
|
755
|
-
*/
|
|
753
|
+
* Starts the Vite server in preview mode, to simulate a production deployment
|
|
754
|
+
*/
|
|
756
755
|
declare function preview(inlineConfig?: InlineConfig): Promise<PreviewServer>;
|
|
757
756
|
//#endregion
|
|
758
757
|
//#region src/node/shortcuts.d.ts
|
|
759
758
|
type BindCLIShortcutsOptions<Server = ViteDevServer | PreviewServer> = {
|
|
760
759
|
/**
|
|
761
|
-
|
|
762
|
-
|
|
760
|
+
* Print a one-line shortcuts "help" hint to the terminal
|
|
761
|
+
*/
|
|
763
762
|
print?: boolean;
|
|
764
763
|
/**
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
764
|
+
* Custom shortcuts to run when a key is pressed. These shortcuts take priority
|
|
765
|
+
* over the default shortcuts if they have the same keys (except the `h` key).
|
|
766
|
+
* To disable a default shortcut, define the same key but with `action: undefined`.
|
|
767
|
+
*/
|
|
769
768
|
customShortcuts?: CLIShortcut<Server>[];
|
|
770
769
|
};
|
|
771
770
|
type CLIShortcut<Server = ViteDevServer | PreviewServer> = {
|
|
@@ -787,17 +786,17 @@ declare class BaseEnvironment extends PartialEnvironment {
|
|
|
787
786
|
constructor(name: string, config: ResolvedConfig, options?: ResolvedEnvironmentOptions);
|
|
788
787
|
}
|
|
789
788
|
/**
|
|
790
|
-
* This class discourages users from inversely checking the `mode`
|
|
791
|
-
* to determine the type of environment, e.g.
|
|
792
|
-
*
|
|
793
|
-
* ```js
|
|
794
|
-
* const isDev = environment.mode !== 'build' // bad
|
|
795
|
-
* const isDev = environment.mode === 'dev' // good
|
|
796
|
-
* ```
|
|
797
|
-
*
|
|
798
|
-
* You should also not check against `"unknown"` specifically. It's
|
|
799
|
-
* a placeholder for more possible environment types.
|
|
800
|
-
*/
|
|
789
|
+
* This class discourages users from inversely checking the `mode`
|
|
790
|
+
* to determine the type of environment, e.g.
|
|
791
|
+
*
|
|
792
|
+
* ```js
|
|
793
|
+
* const isDev = environment.mode !== 'build' // bad
|
|
794
|
+
* const isDev = environment.mode === 'dev' // good
|
|
795
|
+
* ```
|
|
796
|
+
*
|
|
797
|
+
* You should also not check against `"unknown"` specifically. It's
|
|
798
|
+
* a placeholder for more possible environment types.
|
|
799
|
+
*/
|
|
801
800
|
declare class UnknownEnvironment extends BaseEnvironment {
|
|
802
801
|
mode: "unknown";
|
|
803
802
|
}
|
|
@@ -829,115 +828,115 @@ interface DepsOptimizer {
|
|
|
829
828
|
}
|
|
830
829
|
interface DepOptimizationConfig {
|
|
831
830
|
/**
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
831
|
+
* Force optimize listed dependencies (must be resolvable import paths,
|
|
832
|
+
* cannot be globs).
|
|
833
|
+
*/
|
|
835
834
|
include?: string[];
|
|
836
835
|
/**
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
836
|
+
* Do not optimize these dependencies (must be resolvable import paths,
|
|
837
|
+
* cannot be globs).
|
|
838
|
+
*/
|
|
840
839
|
exclude?: string[];
|
|
841
840
|
/**
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
841
|
+
* Forces ESM interop when importing these dependencies. Some legacy
|
|
842
|
+
* packages advertise themselves as ESM but use `require` internally
|
|
843
|
+
* @experimental
|
|
844
|
+
*/
|
|
846
845
|
needsInterop?: string[];
|
|
847
846
|
/**
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
847
|
+
* Options to pass to esbuild during the dep scanning and optimization
|
|
848
|
+
*
|
|
849
|
+
* Certain options are omitted since changing them would not be compatible
|
|
850
|
+
* with Vite's dep optimization.
|
|
851
|
+
*
|
|
852
|
+
* - `external` is also omitted, use Vite's `optimizeDeps.exclude` option
|
|
853
|
+
* - `plugins` are merged with Vite's dep plugin
|
|
854
|
+
*
|
|
855
|
+
* https://esbuild.github.io/api
|
|
856
|
+
*
|
|
857
|
+
* @deprecated Use `rolldownOptions` instead.
|
|
858
|
+
*/
|
|
860
859
|
esbuildOptions?: DepsOptimizerEsbuildOptions;
|
|
861
860
|
/**
|
|
862
|
-
|
|
863
|
-
|
|
861
|
+
* @deprecated Use `rolldownOptions` instead.
|
|
862
|
+
*/
|
|
864
863
|
rollupOptions?: Omit<RolldownOptions, "input" | "logLevel" | "output"> & {
|
|
865
864
|
output?: Omit<OutputOptions, "format" | "sourcemap" | "dir" | "banner">;
|
|
866
865
|
};
|
|
867
866
|
/**
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
867
|
+
* Options to pass to rolldown during the dep scanning and optimization
|
|
868
|
+
*
|
|
869
|
+
* Certain options are omitted since changing them would not be compatible
|
|
870
|
+
* with Vite's dep optimization.
|
|
871
|
+
*
|
|
872
|
+
* - `plugins` are merged with Vite's dep plugin
|
|
873
|
+
*/
|
|
875
874
|
rolldownOptions?: Omit<RolldownOptions, "input" | "logLevel" | "output"> & {
|
|
876
875
|
output?: Omit<OutputOptions, "format" | "sourcemap" | "dir" | "banner">;
|
|
877
876
|
};
|
|
878
877
|
/**
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
878
|
+
* List of file extensions that can be optimized. A corresponding esbuild
|
|
879
|
+
* plugin must exist to handle the specific extension.
|
|
880
|
+
*
|
|
881
|
+
* By default, Vite can optimize `.mjs`, `.js`, `.ts`, and `.mts` files. This option
|
|
882
|
+
* allows specifying additional extensions.
|
|
883
|
+
*
|
|
884
|
+
* @experimental
|
|
885
|
+
*/
|
|
887
886
|
extensions?: string[];
|
|
888
887
|
/**
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
888
|
+
* Deps optimization during build was removed in Vite 5.1. This option is
|
|
889
|
+
* now redundant and will be removed in a future version. Switch to using
|
|
890
|
+
* `optimizeDeps.noDiscovery` and an empty or undefined `optimizeDeps.include`.
|
|
891
|
+
* true or 'dev' disables the optimizer, false or 'build' leaves it enabled.
|
|
892
|
+
* @default 'build'
|
|
893
|
+
* @deprecated
|
|
894
|
+
* @experimental
|
|
895
|
+
*/
|
|
897
896
|
disabled?: boolean | "build" | "dev";
|
|
898
897
|
/**
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
898
|
+
* Automatic dependency discovery. When `noDiscovery` is true, only dependencies
|
|
899
|
+
* listed in `include` will be optimized. The scanner isn't run for cold start
|
|
900
|
+
* in this case. CJS-only dependencies must be present in `include` during dev.
|
|
901
|
+
* @default false
|
|
902
|
+
*/
|
|
904
903
|
noDiscovery?: boolean;
|
|
905
904
|
/**
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
905
|
+
* When enabled, it will hold the first optimized deps results until all static
|
|
906
|
+
* imports are crawled on cold start. This avoids the need for full-page reloads
|
|
907
|
+
* when new dependencies are discovered and they trigger the generation of new
|
|
908
|
+
* common chunks. If all dependencies are found by the scanner plus the explicitly
|
|
909
|
+
* defined ones in `include`, it is better to disable this option to let the
|
|
910
|
+
* browser process more requests in parallel.
|
|
911
|
+
* @default true
|
|
912
|
+
* @experimental
|
|
913
|
+
*/
|
|
915
914
|
holdUntilCrawlEnd?: boolean;
|
|
916
915
|
/**
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
916
|
+
* When enabled, Vite will not throw an error when an outdated optimized
|
|
917
|
+
* dependency is requested. Enabling this option may cause a single module
|
|
918
|
+
* to have a multiple reference.
|
|
919
|
+
* @default false
|
|
920
|
+
* @experimental
|
|
921
|
+
*/
|
|
923
922
|
ignoreOutdatedRequests?: boolean;
|
|
924
923
|
}
|
|
925
924
|
type DepOptimizationOptions = DepOptimizationConfig & {
|
|
926
925
|
/**
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
926
|
+
* By default, Vite will crawl your `index.html` to detect dependencies that
|
|
927
|
+
* need to be pre-bundled. If `build.rolldownOptions.input` is specified, Vite
|
|
928
|
+
* will crawl those entry points instead.
|
|
929
|
+
*
|
|
930
|
+
* If neither of these fit your needs, you can specify custom entries using
|
|
931
|
+
* this option - the value should be a tinyglobby pattern or array of patterns
|
|
932
|
+
* (https://github.com/SuperchupuDev/tinyglobby) that are relative from
|
|
933
|
+
* vite project root. This will overwrite default entries inference.
|
|
934
|
+
*/
|
|
936
935
|
entries?: string | string[];
|
|
937
936
|
/**
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
937
|
+
* Force dep pre-optimization regardless of whether deps have changed.
|
|
938
|
+
* @experimental
|
|
939
|
+
*/
|
|
941
940
|
force?: boolean;
|
|
942
941
|
};
|
|
943
942
|
interface OptimizedDepInfo {
|
|
@@ -948,62 +947,62 @@ interface OptimizedDepInfo {
|
|
|
948
947
|
browserHash?: string;
|
|
949
948
|
fileHash?: string;
|
|
950
949
|
/**
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
950
|
+
* During optimization, ids can still be resolved to their final location
|
|
951
|
+
* but the bundles may not yet be saved to disk
|
|
952
|
+
*/
|
|
954
953
|
processing?: Promise<void>;
|
|
955
954
|
/**
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
955
|
+
* ExportData cache, discovered deps will parse the src entry to get exports
|
|
956
|
+
* data used both to define if interop is needed and when pre-bundling
|
|
957
|
+
*/
|
|
959
958
|
exportsData?: Promise<ExportsData>;
|
|
960
959
|
isDynamicEntry?: boolean;
|
|
961
960
|
}
|
|
962
961
|
interface DepOptimizationMetadata {
|
|
963
962
|
/**
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
963
|
+
* The main hash is determined by user config and dependency lockfiles.
|
|
964
|
+
* This is checked on server startup to avoid unnecessary re-bundles.
|
|
965
|
+
*/
|
|
967
966
|
hash: string;
|
|
968
967
|
/**
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
968
|
+
* This hash is determined by dependency lockfiles.
|
|
969
|
+
* This is checked on server startup to avoid unnecessary re-bundles.
|
|
970
|
+
*/
|
|
972
971
|
lockfileHash: string;
|
|
973
972
|
/**
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
973
|
+
* This hash is determined by user config.
|
|
974
|
+
* This is checked on server startup to avoid unnecessary re-bundles.
|
|
975
|
+
*/
|
|
977
976
|
configHash: string;
|
|
978
977
|
/**
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
978
|
+
* The browser hash is determined by the main hash plus additional dependencies
|
|
979
|
+
* discovered at runtime. This is used to invalidate browser requests to
|
|
980
|
+
* optimized deps.
|
|
981
|
+
*/
|
|
983
982
|
browserHash: string;
|
|
984
983
|
/**
|
|
985
|
-
|
|
986
|
-
|
|
984
|
+
* Metadata for each already optimized dependency
|
|
985
|
+
*/
|
|
987
986
|
optimized: Record<string, OptimizedDepInfo>;
|
|
988
987
|
/**
|
|
989
|
-
|
|
990
|
-
|
|
988
|
+
* Metadata for non-entry optimized chunks and dynamic imports
|
|
989
|
+
*/
|
|
991
990
|
chunks: Record<string, OptimizedDepInfo>;
|
|
992
991
|
/**
|
|
993
|
-
|
|
994
|
-
|
|
992
|
+
* Metadata for each newly discovered dependency after processing
|
|
993
|
+
*/
|
|
995
994
|
discovered: Record<string, OptimizedDepInfo>;
|
|
996
995
|
/**
|
|
997
|
-
|
|
998
|
-
|
|
996
|
+
* OptimizedDepInfo list
|
|
997
|
+
*/
|
|
999
998
|
depInfoList: OptimizedDepInfo[];
|
|
1000
999
|
}
|
|
1001
1000
|
/**
|
|
1002
|
-
* Scan and optimize dependencies within a project.
|
|
1003
|
-
* Used by Vite CLI when running `vite optimize`.
|
|
1004
|
-
*
|
|
1005
|
-
* @deprecated the optimization process runs automatically and does not need to be called
|
|
1006
|
-
*/
|
|
1001
|
+
* Scan and optimize dependencies within a project.
|
|
1002
|
+
* Used by Vite CLI when running `vite optimize`.
|
|
1003
|
+
*
|
|
1004
|
+
* @deprecated the optimization process runs automatically and does not need to be called
|
|
1005
|
+
*/
|
|
1007
1006
|
declare function optimizeDeps(config: ResolvedConfig, force?: boolean | undefined, asCommand?: boolean): Promise<DepOptimizationMetadata>;
|
|
1008
1007
|
//#endregion
|
|
1009
1008
|
//#region src/node/server/transformRequest.d.ts
|
|
@@ -1019,8 +1018,8 @@ interface TransformResult {
|
|
|
1019
1018
|
}
|
|
1020
1019
|
interface TransformOptions {
|
|
1021
1020
|
/**
|
|
1022
|
-
|
|
1023
|
-
|
|
1021
|
+
* @deprecated inferred from environment
|
|
1022
|
+
*/
|
|
1024
1023
|
ssr?: boolean;
|
|
1025
1024
|
}
|
|
1026
1025
|
//#endregion
|
|
@@ -1028,12 +1027,12 @@ interface TransformOptions {
|
|
|
1028
1027
|
declare class EnvironmentModuleNode {
|
|
1029
1028
|
environment: string;
|
|
1030
1029
|
/**
|
|
1031
|
-
|
|
1032
|
-
|
|
1030
|
+
* Public served url path, starts with /
|
|
1031
|
+
*/
|
|
1033
1032
|
url: string;
|
|
1034
1033
|
/**
|
|
1035
|
-
|
|
1036
|
-
|
|
1034
|
+
* Resolved file system path + query
|
|
1035
|
+
*/
|
|
1037
1036
|
id: string | null;
|
|
1038
1037
|
file: string | null;
|
|
1039
1038
|
type: "js" | "css" | "asset";
|
|
@@ -1051,8 +1050,8 @@ declare class EnvironmentModuleNode {
|
|
|
1051
1050
|
lastHMRTimestamp: number;
|
|
1052
1051
|
lastInvalidationTimestamp: number;
|
|
1053
1052
|
/**
|
|
1054
|
-
|
|
1055
|
-
|
|
1053
|
+
* @param setIsSelfAccepting - set `false` to set `isSelfAccepting` later. e.g. #7870
|
|
1054
|
+
*/
|
|
1056
1055
|
constructor(url: string, environment: string, setIsSelfAccepting?: boolean);
|
|
1057
1056
|
}
|
|
1058
1057
|
type ResolvedUrl = [url: string, resolvedId: string, meta: object | null | undefined];
|
|
@@ -1071,13 +1070,13 @@ declare class EnvironmentModuleGraph {
|
|
|
1071
1070
|
invalidateModule(mod: EnvironmentModuleNode, seen?: Set<EnvironmentModuleNode>, timestamp?: number, isHmr?: boolean, softInvalidate?: boolean): void;
|
|
1072
1071
|
invalidateAll(): void;
|
|
1073
1072
|
/**
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1073
|
+
* Update the module graph based on a module's updated imports information
|
|
1074
|
+
* If there are dependencies that no longer have any importers, they are
|
|
1075
|
+
* returned as a Set.
|
|
1076
|
+
*
|
|
1077
|
+
* @param staticImportedUrls Subset of `importedModules` where they're statically imported in code.
|
|
1078
|
+
* This is only used for soft invalidations so `undefined` is fine but may cause more runtime processing.
|
|
1079
|
+
*/
|
|
1081
1080
|
updateModuleInfo(mod: EnvironmentModuleNode, importedModules: Set<string | EnvironmentModuleNode>, importedBindings: Map<string, Set<string>> | null, acceptedModules: Set<string | EnvironmentModuleNode>, acceptedExports: Set<string> | null, isSelfAccepting: boolean, staticImportedUrls?: Set<string>): Promise<Set<EnvironmentModuleNode> | undefined>;
|
|
1082
1081
|
ensureEntryFromUrl(rawUrl: string, setIsSelfAccepting?: boolean): Promise<EnvironmentModuleNode>;
|
|
1083
1082
|
createFileOnlyEntry(file: string): EnvironmentModuleNode;
|
|
@@ -1168,33 +1167,33 @@ interface WsOptions {
|
|
|
1168
1167
|
}
|
|
1169
1168
|
interface HmrOptions {
|
|
1170
1169
|
/**
|
|
1171
|
-
|
|
1172
|
-
|
|
1170
|
+
* @deprecated Use `server.ws.protocol` instead.
|
|
1171
|
+
*/
|
|
1173
1172
|
protocol?: string;
|
|
1174
1173
|
/**
|
|
1175
|
-
|
|
1176
|
-
|
|
1174
|
+
* @deprecated Use `server.ws.host` instead.
|
|
1175
|
+
*/
|
|
1177
1176
|
host?: string;
|
|
1178
1177
|
/**
|
|
1179
|
-
|
|
1180
|
-
|
|
1178
|
+
* @deprecated Use `server.ws.port` instead.
|
|
1179
|
+
*/
|
|
1181
1180
|
port?: number;
|
|
1182
1181
|
/**
|
|
1183
|
-
|
|
1184
|
-
|
|
1182
|
+
* @deprecated Use `server.ws.clientPort` instead.
|
|
1183
|
+
*/
|
|
1185
1184
|
clientPort?: number;
|
|
1186
1185
|
/**
|
|
1187
|
-
|
|
1188
|
-
|
|
1186
|
+
* @deprecated Use `server.ws.path` instead.
|
|
1187
|
+
*/
|
|
1189
1188
|
path?: string;
|
|
1190
1189
|
/**
|
|
1191
|
-
|
|
1192
|
-
|
|
1190
|
+
* @deprecated Use `server.ws.timeout` instead.
|
|
1191
|
+
*/
|
|
1193
1192
|
timeout?: number;
|
|
1194
1193
|
overlay?: boolean;
|
|
1195
1194
|
/**
|
|
1196
|
-
|
|
1197
|
-
|
|
1195
|
+
* @deprecated Use `server.ws.server` instead.
|
|
1196
|
+
*/
|
|
1198
1197
|
server?: HttpServer;
|
|
1199
1198
|
}
|
|
1200
1199
|
interface HotUpdateOptions {
|
|
@@ -1218,63 +1217,63 @@ interface HotChannelClient {
|
|
|
1218
1217
|
type HotChannelListener<T extends string = string> = (data: InferCustomEventPayload<T>, client: HotChannelClient) => void;
|
|
1219
1218
|
interface HotChannel<Api = any> {
|
|
1220
1219
|
/**
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1220
|
+
* When true, the fs access check is skipped in fetchModule.
|
|
1221
|
+
* Set this for transports that is not exposed over the network.
|
|
1222
|
+
*/
|
|
1224
1223
|
skipFsCheck?: boolean;
|
|
1225
1224
|
/**
|
|
1226
|
-
|
|
1227
|
-
|
|
1225
|
+
* Broadcast events to all clients
|
|
1226
|
+
*/
|
|
1228
1227
|
send?(payload: hmrPayload_HotPayload): void;
|
|
1229
1228
|
/**
|
|
1230
|
-
|
|
1231
|
-
|
|
1229
|
+
* Handle custom event emitted by `import.meta.hot.send`
|
|
1230
|
+
*/
|
|
1232
1231
|
on?<T extends string>(event: T, listener: HotChannelListener<T>): void;
|
|
1233
1232
|
on?(event: "connection", listener: () => void): void;
|
|
1234
1233
|
/**
|
|
1235
|
-
|
|
1236
|
-
|
|
1234
|
+
* Unregister event listener
|
|
1235
|
+
*/
|
|
1237
1236
|
off?(event: string, listener: Function): void;
|
|
1238
1237
|
/**
|
|
1239
|
-
|
|
1240
|
-
|
|
1238
|
+
* Start listening for messages
|
|
1239
|
+
*/
|
|
1241
1240
|
listen?(): void;
|
|
1242
1241
|
/**
|
|
1243
|
-
|
|
1244
|
-
|
|
1242
|
+
* Disconnect all clients, called when server is closed or restarted.
|
|
1243
|
+
*/
|
|
1245
1244
|
close?(): Promise<unknown> | void;
|
|
1246
1245
|
api?: Api;
|
|
1247
1246
|
}
|
|
1248
1247
|
interface NormalizedHotChannelClient {
|
|
1249
1248
|
/**
|
|
1250
|
-
|
|
1251
|
-
|
|
1249
|
+
* Send event to the client
|
|
1250
|
+
*/
|
|
1252
1251
|
send(payload: hmrPayload_HotPayload): void;
|
|
1253
1252
|
/**
|
|
1254
|
-
|
|
1255
|
-
|
|
1253
|
+
* Send custom event
|
|
1254
|
+
*/
|
|
1256
1255
|
send(event: string, payload?: hmrPayload_CustomPayload["data"]): void;
|
|
1257
1256
|
}
|
|
1258
1257
|
interface NormalizedHotChannel<Api = any> {
|
|
1259
1258
|
/**
|
|
1260
|
-
|
|
1261
|
-
|
|
1259
|
+
* Broadcast events to all clients
|
|
1260
|
+
*/
|
|
1262
1261
|
send(payload: hmrPayload_HotPayload): void;
|
|
1263
1262
|
/**
|
|
1264
|
-
|
|
1265
|
-
|
|
1263
|
+
* Send custom event
|
|
1264
|
+
*/
|
|
1266
1265
|
send<T extends string>(event: T, payload?: InferCustomEventPayload<T>): void;
|
|
1267
1266
|
/**
|
|
1268
|
-
|
|
1269
|
-
|
|
1267
|
+
* Handle custom event emitted by `import.meta.hot.send`
|
|
1268
|
+
*/
|
|
1270
1269
|
on<T extends string>(event: T, listener: (data: InferCustomEventPayload<T>, client: NormalizedHotChannelClient) => void): void;
|
|
1271
1270
|
/**
|
|
1272
|
-
|
|
1273
|
-
|
|
1271
|
+
* @deprecated use `vite:client:connect` event instead
|
|
1272
|
+
*/
|
|
1274
1273
|
on(event: "connection", listener: () => void): void;
|
|
1275
1274
|
/**
|
|
1276
|
-
|
|
1277
|
-
|
|
1275
|
+
* Unregister event listener
|
|
1276
|
+
*/
|
|
1278
1277
|
off(event: string, listener: Function): void;
|
|
1279
1278
|
handleInvoke(payload: hmrPayload_HotPayload): Promise<{
|
|
1280
1279
|
result: any;
|
|
@@ -1282,12 +1281,12 @@ interface NormalizedHotChannel<Api = any> {
|
|
|
1282
1281
|
error: any;
|
|
1283
1282
|
}>;
|
|
1284
1283
|
/**
|
|
1285
|
-
|
|
1286
|
-
|
|
1284
|
+
* Start listening for messages
|
|
1285
|
+
*/
|
|
1287
1286
|
listen(): void;
|
|
1288
1287
|
/**
|
|
1289
|
-
|
|
1290
|
-
|
|
1288
|
+
* Disconnect all clients, called when server is closed or restarted.
|
|
1289
|
+
*/
|
|
1291
1290
|
close(): Promise<unknown> | void;
|
|
1292
1291
|
api?: Api;
|
|
1293
1292
|
}
|
|
@@ -1355,7 +1354,8 @@ declare class WebSocket extends EventEmitter {
|
|
|
1355
1354
|
* Make a paused socket resume emitting events. This method is a noop if the ready
|
|
1356
1355
|
* state is `CONNECTING` or `CLOSED`.
|
|
1357
1356
|
*/
|
|
1358
|
-
resume(): void;
|
|
1357
|
+
resume(): void;
|
|
1358
|
+
// HTML5 WebSocket events
|
|
1359
1359
|
addEventListener(method: 'message', cb: (event: WebSocket.MessageEvent) => void, options?: WebSocket.EventListenerOptions): void;
|
|
1360
1360
|
addEventListener(method: 'close', cb: (event: WebSocket.CloseEvent) => void, options?: WebSocket.EventListenerOptions): void;
|
|
1361
1361
|
addEventListener(method: 'error', cb: (event: WebSocket.ErrorEvent) => void, options?: WebSocket.EventListenerOptions): void;
|
|
@@ -1363,7 +1363,8 @@ declare class WebSocket extends EventEmitter {
|
|
|
1363
1363
|
removeEventListener(method: 'message', cb: (event: WebSocket.MessageEvent) => void): void;
|
|
1364
1364
|
removeEventListener(method: 'close', cb: (event: WebSocket.CloseEvent) => void): void;
|
|
1365
1365
|
removeEventListener(method: 'error', cb: (event: WebSocket.ErrorEvent) => void): void;
|
|
1366
|
-
removeEventListener(method: 'open', cb: (event: WebSocket.Event) => void): void;
|
|
1366
|
+
removeEventListener(method: 'open', cb: (event: WebSocket.Event) => void): void;
|
|
1367
|
+
// Events
|
|
1367
1368
|
on(event: 'close', listener: (this: WebSocket, code: number, reason: Buffer) => void): this;
|
|
1368
1369
|
on(event: 'error', listener: (this: WebSocket, err: Error) => void): this;
|
|
1369
1370
|
on(event: 'upgrade', listener: (this: WebSocket, request: http.IncomingMessage) => void): this;
|
|
@@ -1525,7 +1526,8 @@ declare namespace WebSocket {
|
|
|
1525
1526
|
address: string;
|
|
1526
1527
|
family: string;
|
|
1527
1528
|
port: number;
|
|
1528
|
-
}
|
|
1529
|
+
}
|
|
1530
|
+
// WebSocket Server
|
|
1529
1531
|
class Server<T extends WebSocket = WebSocket> extends EventEmitter {
|
|
1530
1532
|
options: ServerOptions;
|
|
1531
1533
|
path: string;
|
|
@@ -1534,7 +1536,8 @@ declare namespace WebSocket {
|
|
|
1534
1536
|
address(): AddressInfo | string;
|
|
1535
1537
|
close(cb?: (err?: Error) => void): void;
|
|
1536
1538
|
handleUpgrade(request: http.IncomingMessage, socket: Duplex, upgradeHead: Buffer, callback: (client: T, request: http.IncomingMessage) => void): void;
|
|
1537
|
-
shouldHandle(request: http.IncomingMessage): boolean | Promise<boolean>;
|
|
1539
|
+
shouldHandle(request: http.IncomingMessage): boolean | Promise<boolean>;
|
|
1540
|
+
// Events
|
|
1538
1541
|
on(event: 'connection', cb: (this: Server<T>, socket: T, request: http.IncomingMessage) => void): this;
|
|
1539
1542
|
on(event: 'error', cb: (this: Server<T>, error: Error) => void): this;
|
|
1540
1543
|
on(event: 'headers', cb: (this: Server<T>, headers: string[], request: http.IncomingMessage) => void): this;
|
|
@@ -1564,45 +1567,46 @@ declare namespace WebSocket {
|
|
|
1564
1567
|
const WebSocketServer: typeof Server;
|
|
1565
1568
|
interface WebSocketServer extends Server {}
|
|
1566
1569
|
const WebSocket: typeof WebSocketAlias;
|
|
1567
|
-
interface WebSocket extends WebSocketAlias {}
|
|
1570
|
+
interface WebSocket extends WebSocketAlias {}
|
|
1571
|
+
// WebSocket stream
|
|
1568
1572
|
function createWebSocketStream(websocket: WebSocket, options?: DuplexOptions): Duplex;
|
|
1569
|
-
}
|
|
1573
|
+
}
|
|
1570
1574
|
//#endregion
|
|
1571
1575
|
//#region src/node/server/ws.d.ts
|
|
1572
1576
|
type WebSocketCustomListener<T> = (data: T, client: WebSocketClient) => void;
|
|
1573
1577
|
declare const isWebSocketServer: unique symbol;
|
|
1574
1578
|
interface WebSocketServer extends NormalizedHotChannel {
|
|
1575
1579
|
/**
|
|
1576
|
-
|
|
1577
|
-
|
|
1580
|
+
* Handle custom event emitted by `import.meta.hot.send`
|
|
1581
|
+
*/
|
|
1578
1582
|
on: WebSocket.Server["on"] & {
|
|
1579
1583
|
<T extends string>(event: T, listener: WebSocketCustomListener<hmrPayload_InferCustomEventPayload<T>>): void;
|
|
1580
1584
|
};
|
|
1581
1585
|
/**
|
|
1582
|
-
|
|
1583
|
-
|
|
1586
|
+
* Unregister event listener.
|
|
1587
|
+
*/
|
|
1584
1588
|
off: WebSocket.Server["off"] & {
|
|
1585
1589
|
(event: string, listener: Function): void;
|
|
1586
1590
|
};
|
|
1587
1591
|
/**
|
|
1588
|
-
|
|
1589
|
-
|
|
1592
|
+
* Listen on port and host
|
|
1593
|
+
*/
|
|
1590
1594
|
listen(): void;
|
|
1591
1595
|
/**
|
|
1592
|
-
|
|
1593
|
-
|
|
1596
|
+
* Disconnect all clients and terminate the server.
|
|
1597
|
+
*/
|
|
1594
1598
|
close(): Promise<void>;
|
|
1595
1599
|
[isWebSocketServer]: true;
|
|
1596
1600
|
/**
|
|
1597
|
-
|
|
1598
|
-
|
|
1601
|
+
* Get all connected clients.
|
|
1602
|
+
*/
|
|
1599
1603
|
clients: Set<WebSocketClient>;
|
|
1600
1604
|
}
|
|
1601
1605
|
interface WebSocketClient extends NormalizedHotChannelClient {
|
|
1602
1606
|
/**
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1607
|
+
* The raw WebSocket instance
|
|
1608
|
+
* @advanced
|
|
1609
|
+
*/
|
|
1606
1610
|
socket: WebSocket;
|
|
1607
1611
|
}
|
|
1608
1612
|
//#endregion
|
|
@@ -1623,23 +1627,30 @@ declare class BundledDev {
|
|
|
1623
1627
|
private environment;
|
|
1624
1628
|
private _devEngine;
|
|
1625
1629
|
private initialBuildCompleted;
|
|
1630
|
+
private _closed;
|
|
1626
1631
|
private clients;
|
|
1627
|
-
private invalidateCalledModules;
|
|
1628
1632
|
private debouncedFullReload;
|
|
1629
1633
|
private fullReloadPending;
|
|
1630
1634
|
private lastBuildError;
|
|
1631
1635
|
memoryFiles: MemoryFiles;
|
|
1632
1636
|
constructor(environment: DevEnvironment);
|
|
1633
1637
|
private get devEngine();
|
|
1638
|
+
private pendingPayloadFilenames;
|
|
1634
1639
|
listen(): Promise<void>;
|
|
1635
1640
|
private waitForInitialBuildFinish;
|
|
1636
|
-
invalidateModule(m: {
|
|
1637
|
-
path: string;
|
|
1638
|
-
message?: string;
|
|
1639
|
-
firstInvalidatedBy: string;
|
|
1640
|
-
}, client: NormalizedHotChannelClient): Promise<void>;
|
|
1641
1641
|
triggerBundleRegenerationIfStale(): Promise<boolean>;
|
|
1642
|
-
triggerLazyBundling(moduleId: string | null, clientId: string | null): Promise<
|
|
1642
|
+
triggerLazyBundling(moduleId: string | null, clientId: string | null): Promise<{
|
|
1643
|
+
code: string;
|
|
1644
|
+
filename: string;
|
|
1645
|
+
} | undefined>;
|
|
1646
|
+
/**
|
|
1647
|
+
* Called by the serving middlewares when the response for a payload completed.
|
|
1648
|
+
* Only delivered payloads are recorded on the server's per-client ship map, so
|
|
1649
|
+
* later chunks may omit a module only if the payload carrying it was delivered.
|
|
1650
|
+
*
|
|
1651
|
+
* Note: the payload filename is unique across all clients.
|
|
1652
|
+
*/
|
|
1653
|
+
markPayloadDelivered(filename: string): void;
|
|
1643
1654
|
close(): Promise<void>;
|
|
1644
1655
|
private storeOutputFiles;
|
|
1645
1656
|
private getRolldownOptions;
|
|
@@ -1662,37 +1673,37 @@ declare class DevEnvironment extends BaseEnvironment {
|
|
|
1662
1673
|
depsOptimizer?: DepsOptimizer;
|
|
1663
1674
|
get pluginContainer(): EnvironmentPluginContainer<DevEnvironment>;
|
|
1664
1675
|
/**
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1676
|
+
* Hot channel for this environment. If not provided or disabled,
|
|
1677
|
+
* it will be a noop channel that does nothing.
|
|
1678
|
+
*
|
|
1679
|
+
* @example
|
|
1680
|
+
* environment.hot.send({ type: 'full-reload' })
|
|
1681
|
+
*/
|
|
1671
1682
|
hot: NormalizedHotChannel;
|
|
1672
1683
|
bundledDev?: BundledDev;
|
|
1673
1684
|
constructor(name: string, config: ResolvedConfig, context: DevEnvironmentContext);
|
|
1674
1685
|
init(options?: {
|
|
1675
1686
|
watcher?: FSWatcher;
|
|
1676
1687
|
/**
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1688
|
+
* the previous instance used for the environment with the same name
|
|
1689
|
+
*
|
|
1690
|
+
* when using, the consumer should check if it's an instance generated from the same class or factory function
|
|
1691
|
+
*/
|
|
1681
1692
|
previousInstance?: DevEnvironment;
|
|
1682
1693
|
}): Promise<void>;
|
|
1683
1694
|
/**
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1695
|
+
* When the dev server is restarted, the methods are called in the following order:
|
|
1696
|
+
* - new instance `init`
|
|
1697
|
+
* - previous instance `close`
|
|
1698
|
+
* - new instance `listen`
|
|
1699
|
+
*/
|
|
1689
1700
|
listen(server: ViteDevServer): Promise<void>;
|
|
1690
1701
|
/**
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1702
|
+
* Called by the module runner to retrieve information about the specified
|
|
1703
|
+
* module. Internally calls `transformRequest` and wraps the result in the
|
|
1704
|
+
* format that the module runner understands.
|
|
1705
|
+
* This method is not meant to be called manually.
|
|
1706
|
+
*/
|
|
1696
1707
|
fetchModule(id: string, importer?: string, options?: FetchFunctionOptions): Promise<moduleRunner_FetchResult>;
|
|
1697
1708
|
reloadModule(module: EnvironmentModuleNode): Promise<void>;
|
|
1698
1709
|
transformRequest(url: string): Promise<TransformResult | null>;
|
|
@@ -1704,13 +1715,13 @@ declare class DevEnvironment extends BaseEnvironment {
|
|
|
1704
1715
|
}, _client: NormalizedHotChannelClient): void;
|
|
1705
1716
|
close(): Promise<void>;
|
|
1706
1717
|
/**
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1718
|
+
* Calling `await environment.waitForRequestsIdle(id)` will wait until all static imports
|
|
1719
|
+
* are processed after the first transformRequest call. If called from a load or transform
|
|
1720
|
+
* plugin hook, the id needs to be passed as a parameter to avoid deadlocks.
|
|
1721
|
+
* Calling this function after the first static imports section of the module graph has been
|
|
1722
|
+
* processed will resolve immediately.
|
|
1723
|
+
* @experimental
|
|
1724
|
+
*/
|
|
1714
1725
|
waitForRequestsIdle(ignoredId?: string): Promise<void>;
|
|
1715
1726
|
}
|
|
1716
1727
|
//#endregion
|
|
@@ -1951,55 +1962,54 @@ interface RollupDynamicImportVarsOptions {
|
|
|
1951
1962
|
//#region src/node/plugins/terser.d.ts
|
|
1952
1963
|
interface TerserOptions extends TerserMinifyOptions {
|
|
1953
1964
|
/**
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1965
|
+
* Vite-specific option to specify the max number of workers to spawn
|
|
1966
|
+
* when minifying files with terser.
|
|
1967
|
+
*
|
|
1968
|
+
* @default number of CPUs minus 1
|
|
1969
|
+
*/
|
|
1959
1970
|
maxWorkers?: number;
|
|
1960
1971
|
}
|
|
1961
1972
|
//#endregion
|
|
1962
1973
|
//#region src/node/plugins/resolve.d.ts
|
|
1963
1974
|
interface EnvironmentResolveOptions {
|
|
1964
1975
|
/**
|
|
1965
|
-
|
|
1966
|
-
|
|
1976
|
+
* @default ['browser', 'module', 'jsnext:main', 'jsnext']
|
|
1977
|
+
*/
|
|
1967
1978
|
mainFields?: string[];
|
|
1968
1979
|
conditions?: string[];
|
|
1969
1980
|
externalConditions?: string[];
|
|
1970
1981
|
/**
|
|
1971
|
-
|
|
1972
|
-
|
|
1982
|
+
* @default ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']
|
|
1983
|
+
*/
|
|
1973
1984
|
extensions?: string[];
|
|
1974
1985
|
dedupe?: string[];
|
|
1975
1986
|
/**
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1987
|
+
* Prevent listed dependencies from being externalized and will get bundled in build.
|
|
1988
|
+
* Only works in server environments for now. Previously this was `ssr.noExternal`.
|
|
1989
|
+
* @experimental
|
|
1990
|
+
*/
|
|
1980
1991
|
noExternal?: string | RegExp | (string | RegExp)[] | true;
|
|
1981
1992
|
/**
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1993
|
+
* Externalize the given dependencies and their transitive dependencies.
|
|
1994
|
+
* Only works in server environments for now. Previously this was `ssr.external`.
|
|
1995
|
+
* @experimental
|
|
1996
|
+
*/
|
|
1986
1997
|
external?: string[] | true;
|
|
1987
1998
|
/**
|
|
1988
|
-
|
|
1989
|
-
|
|
1999
|
+
* Array of strings or regular expressions that indicate what modules are builtin for the environment.
|
|
2000
|
+
*/
|
|
1990
2001
|
builtins?: (string | RegExp)[];
|
|
1991
2002
|
}
|
|
1992
2003
|
interface ResolveOptions extends EnvironmentResolveOptions {
|
|
1993
2004
|
/**
|
|
1994
|
-
|
|
1995
|
-
|
|
2005
|
+
* @default false
|
|
2006
|
+
*/
|
|
1996
2007
|
preserveSymlinks?: boolean;
|
|
1997
2008
|
/**
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
*/
|
|
2009
|
+
* Enable tsconfig paths resolution
|
|
2010
|
+
*
|
|
2011
|
+
* @default false
|
|
2012
|
+
*/
|
|
2003
2013
|
tsconfigPaths?: boolean;
|
|
2004
2014
|
}
|
|
2005
2015
|
interface ResolvePluginOptions {
|
|
@@ -2008,10 +2018,10 @@ interface ResolvePluginOptions {
|
|
|
2008
2018
|
isProduction: boolean;
|
|
2009
2019
|
packageCache?: PackageCache;
|
|
2010
2020
|
/**
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2021
|
+
* src code mode also attempts the following:
|
|
2022
|
+
* - resolving /xxx as URLs
|
|
2023
|
+
* - resolving bare imports from optimized deps
|
|
2024
|
+
*/
|
|
2015
2025
|
asSrc?: boolean;
|
|
2016
2026
|
tryIndex?: boolean;
|
|
2017
2027
|
tryPrefix?: string;
|
|
@@ -2019,8 +2029,8 @@ interface ResolvePluginOptions {
|
|
|
2019
2029
|
isRequire?: boolean;
|
|
2020
2030
|
scan?: boolean;
|
|
2021
2031
|
/**
|
|
2022
|
-
|
|
2023
|
-
|
|
2032
|
+
* Enable when `legacy.inconsistentCjsInterop` is true. See that option for more details.
|
|
2033
|
+
*/
|
|
2024
2034
|
legacyInconsistentCjsInterop?: boolean;
|
|
2025
2035
|
}
|
|
2026
2036
|
interface InternalResolveOptions extends Required<ResolveOptions>, ResolvePluginOptions {}
|
|
@@ -2050,270 +2060,273 @@ interface PackageData {
|
|
|
2050
2060
|
//#region src/node/plugins/license.d.ts
|
|
2051
2061
|
interface LicenseOptions {
|
|
2052
2062
|
/**
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2063
|
+
* The output file name of the license file relative to the output directory.
|
|
2064
|
+
* Specify a path that ends with `.json` to output the raw JSON metadata.
|
|
2065
|
+
*
|
|
2066
|
+
* @default '.vite/license.md'
|
|
2067
|
+
*/
|
|
2058
2068
|
fileName: string;
|
|
2059
2069
|
}
|
|
2060
2070
|
//#endregion
|
|
2061
2071
|
//#region src/node/build.d.ts
|
|
2062
2072
|
interface BuildEnvironmentOptions {
|
|
2063
2073
|
/**
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2074
|
+
* Compatibility transform target. The transform is performed with esbuild
|
|
2075
|
+
* and the lowest supported target is es2015. Note this only handles
|
|
2076
|
+
* syntax transformation and does not cover polyfills
|
|
2077
|
+
*
|
|
2078
|
+
* Default: 'baseline-widely-available' - transpile targeting browsers that
|
|
2079
|
+
* are included in the Baseline Widely Available on 2026-01-01.
|
|
2080
|
+
* (Chrome 111+, Edge 111+, Firefox 114+, Safari 16.4+).
|
|
2081
|
+
*
|
|
2082
|
+
* Another special value is 'esnext' - which only performs minimal transpiling
|
|
2083
|
+
* (for minification compat).
|
|
2084
|
+
*
|
|
2085
|
+
* For custom targets, see https://esbuild.github.io/api/#target and
|
|
2086
|
+
* https://esbuild.github.io/content-types/#javascript for more details.
|
|
2087
|
+
* @default 'baseline-widely-available'
|
|
2088
|
+
*/
|
|
2079
2089
|
target?: "baseline-widely-available" | EsbuildTarget | false;
|
|
2080
2090
|
/**
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2091
|
+
* whether to inject module preload polyfill.
|
|
2092
|
+
* Note: does not apply to library mode.
|
|
2093
|
+
* @default true
|
|
2094
|
+
* @deprecated use `modulePreload.polyfill` instead
|
|
2095
|
+
*/
|
|
2086
2096
|
polyfillModulePreload?: boolean;
|
|
2087
2097
|
/**
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2098
|
+
* Configure module preload
|
|
2099
|
+
* Note: does not apply to library mode.
|
|
2100
|
+
* @default true
|
|
2101
|
+
*/
|
|
2092
2102
|
modulePreload?: boolean | ModulePreloadOptions;
|
|
2093
2103
|
/**
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2104
|
+
* Directory relative from `root` where build output will be placed. If the
|
|
2105
|
+
* directory exists, it will be removed before the build.
|
|
2106
|
+
* @default 'dist'
|
|
2107
|
+
*/
|
|
2098
2108
|
outDir?: string;
|
|
2099
2109
|
/**
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2110
|
+
* Directory relative from `outDir` where the built js/css/image assets will
|
|
2111
|
+
* be placed.
|
|
2112
|
+
* @default 'assets'
|
|
2113
|
+
*/
|
|
2104
2114
|
assetsDir?: string;
|
|
2105
2115
|
/**
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2116
|
+
* Static asset files smaller than this number (in bytes) will be inlined as
|
|
2117
|
+
* base64 strings. If a callback is passed, a boolean can be returned to opt-in
|
|
2118
|
+
* or opt-out of inlining. If nothing is returned the default logic applies.
|
|
2119
|
+
*
|
|
2120
|
+
* Default limit is `4096` (4 KiB). Set to `0` to disable.
|
|
2121
|
+
* @default 4096
|
|
2122
|
+
*/
|
|
2113
2123
|
assetsInlineLimit?: number | ((filePath: string, content: Buffer) => boolean | undefined);
|
|
2114
2124
|
/**
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2125
|
+
* Whether to code-split CSS. When enabled, CSS in async chunks will be
|
|
2126
|
+
* inlined as strings in the chunk and inserted via dynamically created
|
|
2127
|
+
* style tags when the chunk is loaded.
|
|
2128
|
+
* @default true
|
|
2129
|
+
*/
|
|
2120
2130
|
cssCodeSplit?: boolean;
|
|
2121
2131
|
/**
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2132
|
+
* An optional separate target for CSS minification.
|
|
2133
|
+
* As esbuild only supports configuring targets to mainstream
|
|
2134
|
+
* browsers, users may need this option when they are targeting
|
|
2135
|
+
* a niche browser that comes with most modern JavaScript features
|
|
2136
|
+
* but has poor CSS support, e.g. Android WeChat WebView, which
|
|
2137
|
+
* doesn't support the #RGBA syntax.
|
|
2138
|
+
* @default target
|
|
2139
|
+
*/
|
|
2130
2140
|
cssTarget?: EsbuildTarget | false;
|
|
2131
2141
|
/**
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2142
|
+
* Override CSS minification specifically instead of defaulting to `build.minify`,
|
|
2143
|
+
* so you can configure minification for JS and CSS separately.
|
|
2144
|
+
* @default 'lightningcss', but false if build.minify is disabled for client build
|
|
2145
|
+
*/
|
|
2136
2146
|
cssMinify?: boolean | "lightningcss" | "esbuild";
|
|
2137
2147
|
/**
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2148
|
+
* If `true`, a separate sourcemap file will be created. If 'inline', the
|
|
2149
|
+
* sourcemap will be appended to the resulting output file as data URI.
|
|
2150
|
+
* 'hidden' works like `true` except that the corresponding sourcemap
|
|
2151
|
+
* comments in the bundled files are suppressed.
|
|
2152
|
+
* @default false
|
|
2153
|
+
*/
|
|
2144
2154
|
sourcemap?: boolean | "inline" | "hidden";
|
|
2145
2155
|
/**
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2156
|
+
* Set to `false` to disable minification, or specify the minifier to use.
|
|
2157
|
+
* Available options are 'oxc' or 'terser' or 'esbuild'.
|
|
2158
|
+
* @default 'oxc'
|
|
2159
|
+
*/
|
|
2150
2160
|
minify?: boolean | "oxc" | "terser" | "esbuild";
|
|
2151
2161
|
/**
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2162
|
+
* Options for terser
|
|
2163
|
+
* https://terser.org/docs/api-reference#minify-options
|
|
2164
|
+
*
|
|
2165
|
+
* In addition, you can also pass a `maxWorkers: number` option to specify the
|
|
2166
|
+
* max number of workers to spawn. Defaults to the number of CPUs minus 1.
|
|
2167
|
+
*/
|
|
2158
2168
|
terserOptions?: TerserOptions;
|
|
2159
2169
|
/**
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2170
|
+
* Whether to use import maps feature to optimize chunk caching efficiency.
|
|
2171
|
+
* @default false
|
|
2172
|
+
* @experimental
|
|
2173
|
+
*/
|
|
2164
2174
|
chunkImportMap?: boolean;
|
|
2165
2175
|
/**
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2176
|
+
* Alias to `rolldownOptions`
|
|
2177
|
+
* @deprecated Use `rolldownOptions` instead.
|
|
2178
|
+
*/
|
|
2169
2179
|
rollupOptions?: RolldownOptions;
|
|
2170
2180
|
/**
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2181
|
+
* Will be merged with internal rolldown options.
|
|
2182
|
+
* https://rolldown.rs/reference/Interface.RolldownOptions
|
|
2183
|
+
*/
|
|
2174
2184
|
rolldownOptions?: RolldownOptions;
|
|
2175
2185
|
/**
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2186
|
+
* Options to pass on to `@rollup/plugin-commonjs`
|
|
2187
|
+
* @deprecated This option is no-op and will be removed in future versions.
|
|
2188
|
+
*/
|
|
2179
2189
|
commonjsOptions?: RollupCommonJSOptions;
|
|
2180
2190
|
/**
|
|
2181
|
-
|
|
2182
|
-
|
|
2191
|
+
* Options to pass on to `@rollup/plugin-dynamic-import-vars`
|
|
2192
|
+
*/
|
|
2183
2193
|
dynamicImportVarsOptions?: RollupDynamicImportVarsOptions;
|
|
2184
2194
|
/**
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2195
|
+
* Whether to write bundle to disk
|
|
2196
|
+
* @default true
|
|
2197
|
+
*/
|
|
2188
2198
|
write?: boolean;
|
|
2189
2199
|
/**
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2200
|
+
* Empty outDir on write.
|
|
2201
|
+
* @default true when outDir is a sub directory of project root
|
|
2202
|
+
*/
|
|
2193
2203
|
emptyOutDir?: boolean | null;
|
|
2194
2204
|
/**
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2205
|
+
* Copy the public directory to outDir on write.
|
|
2206
|
+
* @default true
|
|
2207
|
+
*/
|
|
2198
2208
|
copyPublicDir?: boolean;
|
|
2199
2209
|
/**
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2210
|
+
* Whether to emit a `.vite/license.md` file that includes all bundled dependencies'
|
|
2211
|
+
* licenses. Pass an object to customize the output file name.
|
|
2212
|
+
* @default false
|
|
2213
|
+
*/
|
|
2204
2214
|
license?: boolean | LicenseOptions;
|
|
2205
2215
|
/**
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2216
|
+
* Whether to emit a .vite/manifest.json in the output dir to map hash-less filenames
|
|
2217
|
+
* to their hashed versions. Useful when you want to generate your own HTML
|
|
2218
|
+
* instead of using the one generated by Vite.
|
|
2219
|
+
*
|
|
2220
|
+
* Example:
|
|
2221
|
+
*
|
|
2222
|
+
* ```json
|
|
2223
|
+
* {
|
|
2224
|
+
* "main.js": {
|
|
2225
|
+
* "file": "main.68fe3fad.js",
|
|
2226
|
+
* "css": "main.e6b63442.css",
|
|
2227
|
+
* "imports": [...],
|
|
2228
|
+
* "dynamicImports": [...]
|
|
2229
|
+
* }
|
|
2230
|
+
* }
|
|
2231
|
+
* ```
|
|
2232
|
+
* @default false
|
|
2233
|
+
*/
|
|
2224
2234
|
manifest?: boolean | string;
|
|
2225
2235
|
/**
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2236
|
+
* Build in library mode. The value should be the global name of the lib in
|
|
2237
|
+
* UMD mode. This will produce esm + cjs + umd bundle formats with default
|
|
2238
|
+
* configurations that are suitable for distributing libraries.
|
|
2239
|
+
* @default false
|
|
2240
|
+
*/
|
|
2231
2241
|
lib?: LibraryOptions | false;
|
|
2232
2242
|
/**
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2243
|
+
* Produce SSR oriented build. Note this requires specifying SSR entry via
|
|
2244
|
+
* `rolldownOptions.input`.
|
|
2245
|
+
* @default false
|
|
2246
|
+
*/
|
|
2237
2247
|
ssr?: boolean | string;
|
|
2238
2248
|
/**
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2249
|
+
* Generate SSR manifest for determining style links and asset preload
|
|
2250
|
+
* directives in production.
|
|
2251
|
+
* @default false
|
|
2252
|
+
*/
|
|
2243
2253
|
ssrManifest?: boolean | string;
|
|
2244
2254
|
/**
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2255
|
+
* Emit assets during SSR.
|
|
2256
|
+
* @default false
|
|
2257
|
+
*/
|
|
2248
2258
|
ssrEmitAssets?: boolean;
|
|
2249
2259
|
/**
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2260
|
+
* Emit assets during build. Frameworks can set environments.ssr.build.emitAssets
|
|
2261
|
+
* By default, it is true for the client and false for other environments.
|
|
2262
|
+
*/
|
|
2253
2263
|
emitAssets?: boolean;
|
|
2254
2264
|
/**
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2265
|
+
* Set to false to disable reporting compressed chunk sizes.
|
|
2266
|
+
* Can slightly improve build speed.
|
|
2267
|
+
* @default true
|
|
2268
|
+
*/
|
|
2259
2269
|
reportCompressedSize?: boolean;
|
|
2260
2270
|
/**
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2271
|
+
* Adjust chunk size warning limit (in kB).
|
|
2272
|
+
* @default 500
|
|
2273
|
+
*/
|
|
2264
2274
|
chunkSizeWarningLimit?: number;
|
|
2265
2275
|
/**
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2276
|
+
* Rollup watch options
|
|
2277
|
+
* https://rollupjs.org/configuration-options/#watch
|
|
2278
|
+
* @default null
|
|
2279
|
+
*/
|
|
2270
2280
|
watch?: WatcherOptions | null;
|
|
2271
2281
|
/**
|
|
2272
|
-
|
|
2273
|
-
|
|
2282
|
+
* create the Build Environment instance
|
|
2283
|
+
*/
|
|
2274
2284
|
createEnvironment?: (name: string, config: ResolvedConfig) => Promise<BuildEnvironment> | BuildEnvironment;
|
|
2275
2285
|
}
|
|
2276
2286
|
type BuildOptions = BuildEnvironmentOptions;
|
|
2277
2287
|
interface LibraryOptions {
|
|
2278
2288
|
/**
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2289
|
+
* Path of library entry.
|
|
2290
|
+
* Defaults to the top-level `input` option when omitted.
|
|
2291
|
+
*/
|
|
2292
|
+
entry?: InputOption;
|
|
2282
2293
|
/**
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2294
|
+
* The name of the exposed global variable. Required when the `formats` option includes
|
|
2295
|
+
* `umd` or `iife`
|
|
2296
|
+
*/
|
|
2286
2297
|
name?: string;
|
|
2287
2298
|
/**
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2299
|
+
* Output bundle formats. Defaults to `['es', 'umd']` for a single entry, or
|
|
2300
|
+
* `['es', 'cjs']` for multiple entries (`umd` and `iife` do not support
|
|
2301
|
+
* multiple entries).
|
|
2302
|
+
* @default ['es', 'umd']
|
|
2303
|
+
*/
|
|
2291
2304
|
formats?: LibraryFormats[];
|
|
2292
2305
|
/**
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2306
|
+
* The name of the package file output. The default file name is the name option
|
|
2307
|
+
* of the project package.json. It can also be defined as a function taking the
|
|
2308
|
+
* format as an argument.
|
|
2309
|
+
*/
|
|
2297
2310
|
fileName?: string | ((format: ModuleFormat, entryName: string) => string);
|
|
2298
2311
|
/**
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2312
|
+
* The name of the CSS file output if the library imports CSS. Defaults to the
|
|
2313
|
+
* same value as `build.lib.fileName` if it's set a string, otherwise it falls
|
|
2314
|
+
* back to the name option of the project package.json.
|
|
2315
|
+
*/
|
|
2303
2316
|
cssFileName?: string;
|
|
2304
2317
|
}
|
|
2305
2318
|
type LibraryFormats = "es" | "cjs" | "umd" | "iife";
|
|
2306
2319
|
interface ModulePreloadOptions {
|
|
2307
2320
|
/**
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2321
|
+
* Whether to inject a module preload polyfill.
|
|
2322
|
+
* Note: does not apply to library mode.
|
|
2323
|
+
* @default true
|
|
2324
|
+
*/
|
|
2312
2325
|
polyfill?: boolean;
|
|
2313
2326
|
/**
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2327
|
+
* Resolve the list of dependencies to preload for a given dynamic import
|
|
2328
|
+
* @experimental
|
|
2329
|
+
*/
|
|
2317
2330
|
resolveDependencies?: ResolveModulePreloadDependenciesFn;
|
|
2318
2331
|
}
|
|
2319
2332
|
interface ResolvedModulePreloadOptions {
|
|
@@ -2331,9 +2344,9 @@ interface ResolvedBuildOptions extends Required<Omit<BuildOptions, "polyfillModu
|
|
|
2331
2344
|
modulePreload: false | ResolvedModulePreloadOptions;
|
|
2332
2345
|
}
|
|
2333
2346
|
/**
|
|
2334
|
-
* Bundles a single environment for production.
|
|
2335
|
-
* Returns a Promise containing the build result.
|
|
2336
|
-
*/
|
|
2347
|
+
* Bundles a single environment for production.
|
|
2348
|
+
* Returns a Promise containing the build result.
|
|
2349
|
+
*/
|
|
2337
2350
|
declare function build(inlineConfig?: InlineConfig): Promise<RolldownOutput | RolldownOutput[] | RolldownWatcher>;
|
|
2338
2351
|
type RenderBuiltAssetUrl = (filename: string, type: {
|
|
2339
2352
|
type: "asset" | "public";
|
|
@@ -2361,38 +2374,38 @@ interface ViteBuilder {
|
|
|
2361
2374
|
}
|
|
2362
2375
|
interface BuilderOptions {
|
|
2363
2376
|
/**
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2377
|
+
* Whether to share the config instance among environments to align with the behavior of dev server.
|
|
2378
|
+
*
|
|
2379
|
+
* @default false
|
|
2380
|
+
* @experimental
|
|
2381
|
+
*/
|
|
2369
2382
|
sharedConfigBuild?: boolean;
|
|
2370
2383
|
/**
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2384
|
+
* Whether to share the plugin instances among environments to align with the behavior of dev server.
|
|
2385
|
+
*
|
|
2386
|
+
* @default false
|
|
2387
|
+
* @experimental
|
|
2388
|
+
*/
|
|
2376
2389
|
sharedPlugins?: boolean;
|
|
2377
2390
|
buildApp?: (builder: ViteBuilder) => Promise<void>;
|
|
2378
2391
|
}
|
|
2379
2392
|
type ResolvedBuilderOptions = Required<BuilderOptions>;
|
|
2380
2393
|
/**
|
|
2381
|
-
* Creates a ViteBuilder to orchestrate building multiple environments.
|
|
2382
|
-
* @experimental
|
|
2383
|
-
*/
|
|
2394
|
+
* Creates a ViteBuilder to orchestrate building multiple environments.
|
|
2395
|
+
* @experimental
|
|
2396
|
+
*/
|
|
2384
2397
|
declare function createBuilder(inlineConfig?: InlineConfig, useLegacyBuilder?: null | boolean): Promise<ViteBuilder>;
|
|
2385
2398
|
type BuildAppHook = (this: MinimalPluginContextWithoutEnvironment, builder: ViteBuilder) => Promise<void>;
|
|
2386
2399
|
//#endregion
|
|
2387
2400
|
//#region src/node/environment.d.ts
|
|
2388
2401
|
type Environment = DevEnvironment | BuildEnvironment | ScanEnvironment | UnknownEnvironment;
|
|
2389
2402
|
/**
|
|
2390
|
-
* Creates a function that hides the complexities of a WeakMap with an initial value
|
|
2391
|
-
* to implement object metadata. Used by plugins to implement cross hooks per
|
|
2392
|
-
* environment metadata
|
|
2393
|
-
*
|
|
2394
|
-
* @experimental
|
|
2395
|
-
*/
|
|
2403
|
+
* Creates a function that hides the complexities of a WeakMap with an initial value
|
|
2404
|
+
* to implement object metadata. Used by plugins to implement cross hooks per
|
|
2405
|
+
* environment metadata
|
|
2406
|
+
*
|
|
2407
|
+
* @experimental
|
|
2408
|
+
*/
|
|
2396
2409
|
declare function perEnvironmentState<State>(initial: (environment: Environment) => State): (context: PluginContext) => State;
|
|
2397
2410
|
//#endregion
|
|
2398
2411
|
//#region src/node/server/pluginContainer.d.ts
|
|
@@ -2428,7 +2441,8 @@ declare class EnvironmentPluginContainer<Env extends Environment = Environment>
|
|
|
2428
2441
|
resolveId(rawId: string, importer?: string | undefined, options?: {
|
|
2429
2442
|
kind?: ImportKind;
|
|
2430
2443
|
attributes?: Record<string, string>;
|
|
2431
|
-
custom?: CustomPluginOptions;
|
|
2444
|
+
custom?: CustomPluginOptions;
|
|
2445
|
+
/** @deprecated use `skipCalls` instead */
|
|
2432
2446
|
skip?: Set<Plugin>;
|
|
2433
2447
|
skipCalls?: readonly SkipInformation[];
|
|
2434
2448
|
|
|
@@ -2478,7 +2492,8 @@ declare class PluginContainer {
|
|
|
2478
2492
|
}): Promise<void>;
|
|
2479
2493
|
resolveId(rawId: string, importer?: string, options?: {
|
|
2480
2494
|
attributes?: Record<string, string>;
|
|
2481
|
-
custom?: CustomPluginOptions;
|
|
2495
|
+
custom?: CustomPluginOptions;
|
|
2496
|
+
/** @deprecated use `skipCalls` instead */
|
|
2482
2497
|
skip?: Set<Plugin>;
|
|
2483
2498
|
skipCalls?: readonly SkipInformation[];
|
|
2484
2499
|
ssr?: boolean;
|
|
@@ -2500,100 +2515,91 @@ declare class PluginContainer {
|
|
|
2500
2515
|
}>;
|
|
2501
2516
|
close(): Promise<void>;
|
|
2502
2517
|
}
|
|
2503
|
-
/**
|
|
2504
|
-
* server.pluginContainer compatibility
|
|
2505
|
-
*
|
|
2506
|
-
* The default environment is in buildStart, buildEnd, watchChange, and closeBundle hooks,
|
|
2507
|
-
* which are called once for all environments, or when no environment is passed in other hooks.
|
|
2508
|
-
* The ssrEnvironment is needed for backward compatibility when the ssr flag is passed without
|
|
2509
|
-
* an environment. The defaultEnvironment in the main pluginContainer in the server should be
|
|
2510
|
-
* the client environment for backward compatibility.
|
|
2511
|
-
**/
|
|
2512
2518
|
//#endregion
|
|
2513
2519
|
//#region src/node/server/index.d.ts
|
|
2514
2520
|
interface ServerOptions$1 extends CommonServerOptions {
|
|
2515
2521
|
/**
|
|
2516
|
-
|
|
2517
|
-
|
|
2522
|
+
* Configure HMR-specific options (port, host, path & protocol)
|
|
2523
|
+
*/
|
|
2518
2524
|
hmr?: HmrOptions | boolean;
|
|
2519
2525
|
/**
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2526
|
+
* Configure WebSocket connection options.
|
|
2527
|
+
* Set to `false` to disable the WebSocket server and connection.
|
|
2528
|
+
*/
|
|
2523
2529
|
ws?: WsOptions | false;
|
|
2524
2530
|
/**
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2531
|
+
* Warm-up files to transform and cache the results in advance. This improves the
|
|
2532
|
+
* initial page load during server starts and prevents transform waterfalls.
|
|
2533
|
+
*/
|
|
2528
2534
|
warmup?: {
|
|
2529
2535
|
/**
|
|
2530
|
-
|
|
2531
|
-
|
|
2536
|
+
* The files to be transformed and used on the client-side. Supports glob patterns.
|
|
2537
|
+
*/
|
|
2532
2538
|
clientFiles?: string[];
|
|
2533
2539
|
/**
|
|
2534
|
-
|
|
2535
|
-
|
|
2540
|
+
* The files to be transformed and used in SSR. Supports glob patterns.
|
|
2541
|
+
*/
|
|
2536
2542
|
ssrFiles?: string[];
|
|
2537
2543
|
};
|
|
2538
2544
|
/**
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2545
|
+
* chokidar watch options or null to disable FS watching
|
|
2546
|
+
* https://github.com/paulmillr/chokidar/tree/3.6.0#api
|
|
2547
|
+
*/
|
|
2542
2548
|
watch?: WatchOptions | null;
|
|
2543
2549
|
/**
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2550
|
+
* Create Vite dev server to be used as a middleware in an existing server
|
|
2551
|
+
* @default false
|
|
2552
|
+
*/
|
|
2547
2553
|
middlewareMode?: boolean | {
|
|
2548
2554
|
/**
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2555
|
+
* Parent server instance to attach to
|
|
2556
|
+
*
|
|
2557
|
+
* This is needed to proxy WebSocket connections to the parent server.
|
|
2558
|
+
*/
|
|
2553
2559
|
server: HttpServer;
|
|
2554
2560
|
};
|
|
2555
2561
|
/**
|
|
2556
|
-
|
|
2557
|
-
|
|
2562
|
+
* Options for files served via '/\@fs/'.
|
|
2563
|
+
*/
|
|
2558
2564
|
fs?: FileSystemServeOptions;
|
|
2559
2565
|
/**
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2566
|
+
* Origin for the generated asset URLs.
|
|
2567
|
+
*
|
|
2568
|
+
* @example `http://127.0.0.1:8080`
|
|
2569
|
+
*/
|
|
2564
2570
|
origin?: string;
|
|
2565
2571
|
/**
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2572
|
+
* Pre-transform known direct imports
|
|
2573
|
+
* @default true
|
|
2574
|
+
*/
|
|
2569
2575
|
preTransformRequests?: boolean;
|
|
2570
2576
|
/**
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2577
|
+
* Whether or not to ignore-list source files in the dev server sourcemap, used to populate
|
|
2578
|
+
* the [`x_google_ignoreList` source map extension](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension).
|
|
2579
|
+
*
|
|
2580
|
+
* By default, it excludes all paths containing `node_modules`. You can pass `false` to
|
|
2581
|
+
* disable this behavior, or, for full control, a function that takes the source path and
|
|
2582
|
+
* sourcemap path and returns whether to ignore the source path.
|
|
2583
|
+
*/
|
|
2578
2584
|
sourcemapIgnoreList?: false | ((sourcePath: string, sourcemapPath: string) => boolean);
|
|
2579
2585
|
/**
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2586
|
+
* Backward compatibility. The buildStart and buildEnd hooks were called only once for
|
|
2587
|
+
* the client environment. This option enables per-environment buildStart and buildEnd hooks.
|
|
2588
|
+
* @default false
|
|
2589
|
+
* @experimental
|
|
2590
|
+
*/
|
|
2585
2591
|
perEnvironmentStartEndDuringDev?: boolean;
|
|
2586
2592
|
/**
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2593
|
+
* Backward compatibility. The watchChange hook was called only once for the client environment.
|
|
2594
|
+
* This option enables per-environment watchChange hooks.
|
|
2595
|
+
* @default false
|
|
2596
|
+
* @experimental
|
|
2597
|
+
*/
|
|
2592
2598
|
perEnvironmentWatchChangeDuringDev?: boolean;
|
|
2593
2599
|
/**
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2600
|
+
* Run HMR tasks, by default the HMR propagation is done in parallel for all environments
|
|
2601
|
+
* @experimental
|
|
2602
|
+
*/
|
|
2597
2603
|
hotUpdateEnvironments?: (server: ViteDevServer, hmr: (environment: DevEnvironment) => Promise<void>) => Promise<void>;
|
|
2598
2604
|
forwardConsole?: boolean | ForwardConsoleOptions;
|
|
2599
2605
|
}
|
|
@@ -2605,161 +2611,168 @@ interface ResolvedServerOptions extends Omit<RequiredExceptFor<ServerOptions$1,
|
|
|
2605
2611
|
}
|
|
2606
2612
|
interface FileSystemServeOptions {
|
|
2607
2613
|
/**
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
+
* Strictly restrict file accessing outside of allowing paths.
|
|
2615
|
+
*
|
|
2616
|
+
* Set to `false` to disable the warning
|
|
2617
|
+
*
|
|
2618
|
+
* @default true
|
|
2619
|
+
*/
|
|
2614
2620
|
strict?: boolean;
|
|
2615
2621
|
/**
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2622
|
+
* Restrict accessing files outside the allowed directories.
|
|
2623
|
+
*
|
|
2624
|
+
* Accepts absolute path or a path relative to project root.
|
|
2625
|
+
* Will try to search up for workspace root by default.
|
|
2626
|
+
*/
|
|
2621
2627
|
allow?: string[];
|
|
2622
2628
|
/**
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2629
|
+
* Restrict accessing files that matches the patterns.
|
|
2630
|
+
*
|
|
2631
|
+
* This will have higher priority than `allow`.
|
|
2632
|
+
* picomatch patterns are supported.
|
|
2633
|
+
*
|
|
2634
|
+
* @default ['.env', '.env.*', '*.{crt,pem,key,p12,pfx,cer,der}', '.npmrc', '.yarnrc.yml', '**\/.git/**']
|
|
2635
|
+
*/
|
|
2630
2636
|
deny?: string[];
|
|
2631
2637
|
}
|
|
2632
2638
|
type ServerHook = (this: MinimalPluginContextWithoutEnvironment, server: ViteDevServer) => (() => void) | void | Promise<(() => void) | void>;
|
|
2633
2639
|
type HttpServer = http.Server | Http2SecureServer;
|
|
2634
2640
|
interface ViteDevServer {
|
|
2635
2641
|
/**
|
|
2636
|
-
|
|
2637
|
-
|
|
2642
|
+
* The resolved vite config object
|
|
2643
|
+
*/
|
|
2638
2644
|
config: ResolvedConfig;
|
|
2639
2645
|
/**
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2646
|
+
* A connect app instance.
|
|
2647
|
+
* - Can be used to attach custom middlewares to the dev server.
|
|
2648
|
+
* - Can also be used as the handler function of a custom http server
|
|
2649
|
+
* or as a middleware in any connect-style Node.js frameworks
|
|
2650
|
+
*
|
|
2651
|
+
* https://github.com/senchalabs/connect#use-middleware
|
|
2652
|
+
*/
|
|
2647
2653
|
middlewares: Connect.Server;
|
|
2648
2654
|
/**
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2655
|
+
* native Node http server instance
|
|
2656
|
+
* will be null in middleware mode
|
|
2657
|
+
*/
|
|
2652
2658
|
httpServer: HttpServer | null;
|
|
2653
2659
|
/**
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2660
|
+
* Chokidar watcher instance. If `config.server.watch` is set to `null`,
|
|
2661
|
+
* it will not watch any files and calling `add` or `unwatch` will have no effect.
|
|
2662
|
+
* https://github.com/paulmillr/chokidar/tree/3.6.0#api
|
|
2663
|
+
*/
|
|
2658
2664
|
watcher: FSWatcher;
|
|
2659
2665
|
/**
|
|
2660
|
-
|
|
2661
|
-
|
|
2666
|
+
* WebSocket server with `send(payload)` method
|
|
2667
|
+
*/
|
|
2662
2668
|
ws: WebSocketServer;
|
|
2663
2669
|
/**
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2670
|
+
* An alias to `server.environments.client.hot`.
|
|
2671
|
+
* If you want to interact with all environments, loop over `server.environments`.
|
|
2672
|
+
*/
|
|
2667
2673
|
hot: NormalizedHotChannel;
|
|
2668
2674
|
/**
|
|
2669
|
-
|
|
2670
|
-
|
|
2675
|
+
* Rollup plugin container that can run plugin hooks on a given file
|
|
2676
|
+
*/
|
|
2671
2677
|
pluginContainer: PluginContainer;
|
|
2672
2678
|
/**
|
|
2673
|
-
|
|
2674
|
-
|
|
2679
|
+
* Module execution environments attached to the Vite server.
|
|
2680
|
+
*/
|
|
2675
2681
|
environments: Record<"client" | "ssr" | (string & {}), DevEnvironment>;
|
|
2676
2682
|
/**
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2683
|
+
* Module graph that tracks the import relationships, url to file mapping
|
|
2684
|
+
* and hmr state.
|
|
2685
|
+
*/
|
|
2680
2686
|
moduleGraph: ModuleGraph;
|
|
2681
2687
|
/**
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2688
|
+
* The resolved urls Vite prints on the CLI (URL-encoded). Returns `null`
|
|
2689
|
+
* in middleware mode or if the server is not listening on any port.
|
|
2690
|
+
*/
|
|
2685
2691
|
resolvedUrls: ResolvedServerUrls | null;
|
|
2686
2692
|
/**
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2693
|
+
* Programmatically resolve, load and transform a URL and get the result
|
|
2694
|
+
* without going through the http request pipeline.
|
|
2695
|
+
*/
|
|
2690
2696
|
transformRequest(url: string, options?: TransformOptions): Promise<TransformResult | null>;
|
|
2691
2697
|
/**
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2698
|
+
* Same as `transformRequest` but only warm up the URLs so the next request
|
|
2699
|
+
* will already be cached. The function will never throw as it handles and
|
|
2700
|
+
* reports errors internally.
|
|
2701
|
+
*/
|
|
2696
2702
|
warmupRequest(url: string, options?: TransformOptions): Promise<void>;
|
|
2697
2703
|
/**
|
|
2698
|
-
|
|
2699
|
-
|
|
2704
|
+
* Apply vite built-in HTML transforms and any plugin HTML transforms.
|
|
2705
|
+
*/
|
|
2700
2706
|
transformIndexHtml(url: string, html: string, originalUrl?: string): Promise<string>;
|
|
2701
2707
|
/**
|
|
2702
|
-
|
|
2703
|
-
|
|
2708
|
+
* Transform module code into SSR format.
|
|
2709
|
+
*/
|
|
2704
2710
|
ssrTransform(code: string, inMap: SourceMap | {
|
|
2705
2711
|
mappings: "";
|
|
2706
2712
|
} | null, url: string, originalCode?: string): Promise<TransformResult | null>;
|
|
2707
2713
|
/**
|
|
2708
|
-
|
|
2709
|
-
|
|
2714
|
+
* Load a given URL as an instantiated module for SSR.
|
|
2715
|
+
*/
|
|
2710
2716
|
ssrLoadModule(url: string, opts?: {
|
|
2711
2717
|
fixStacktrace?: boolean;
|
|
2712
2718
|
}): Promise<Record<string, any>>;
|
|
2713
2719
|
/**
|
|
2714
|
-
|
|
2715
|
-
|
|
2720
|
+
* Returns a fixed version of the given stack
|
|
2721
|
+
*/
|
|
2716
2722
|
ssrRewriteStacktrace(stack: string): string;
|
|
2717
2723
|
/**
|
|
2718
|
-
|
|
2719
|
-
|
|
2724
|
+
* Mutates the given SSR error by rewriting the stacktrace
|
|
2725
|
+
*/
|
|
2720
2726
|
ssrFixStacktrace(e: Error): void;
|
|
2721
2727
|
/**
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2728
|
+
* Triggers HMR for a module in the module graph. You can use the `server.moduleGraph`
|
|
2729
|
+
* API to retrieve the module to be reloaded. If `hmr` is false, this is a no-op.
|
|
2730
|
+
*/
|
|
2725
2731
|
reloadModule(module: ModuleNode): Promise<void>;
|
|
2726
2732
|
/**
|
|
2727
|
-
|
|
2728
|
-
|
|
2733
|
+
* Start the server.
|
|
2734
|
+
*/
|
|
2729
2735
|
listen(port?: number, isRestart?: boolean): Promise<ViteDevServer>;
|
|
2730
2736
|
/**
|
|
2731
|
-
|
|
2732
|
-
|
|
2737
|
+
* Stop the server.
|
|
2738
|
+
*/
|
|
2733
2739
|
close(): Promise<void>;
|
|
2734
2740
|
/**
|
|
2735
|
-
|
|
2736
|
-
|
|
2741
|
+
* Print server urls
|
|
2742
|
+
*/
|
|
2737
2743
|
printUrls(): void;
|
|
2738
2744
|
/**
|
|
2739
|
-
|
|
2740
|
-
|
|
2745
|
+
* Bind CLI shortcuts
|
|
2746
|
+
*/
|
|
2741
2747
|
bindCLIShortcuts(options?: BindCLIShortcutsOptions<ViteDevServer>): void;
|
|
2742
2748
|
/**
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2749
|
+
* Restart the server.
|
|
2750
|
+
*
|
|
2751
|
+
* @param forceOptimize - force the optimizer to re-bundle, same as --force cli flag
|
|
2752
|
+
*/
|
|
2747
2753
|
restart(forceOptimize?: boolean): Promise<void>;
|
|
2748
2754
|
/**
|
|
2749
|
-
|
|
2750
|
-
|
|
2755
|
+
* Open browser
|
|
2756
|
+
*/
|
|
2751
2757
|
openBrowser(): void;
|
|
2752
2758
|
/**
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2759
|
+
* Calling `await server.waitForRequestsIdle(id)` will wait until all static imports
|
|
2760
|
+
* are processed. If called from a load or transform plugin hook, the id needs to be
|
|
2761
|
+
* passed as a parameter to avoid deadlocks. Calling this function after the first
|
|
2762
|
+
* static imports section of the module graph has been processed will resolve immediately.
|
|
2763
|
+
*/
|
|
2758
2764
|
waitForRequestsIdle: (ignoredId?: string) => Promise<void>;
|
|
2759
2765
|
}
|
|
2760
2766
|
interface ResolvedServerUrls {
|
|
2761
2767
|
local: string[];
|
|
2762
2768
|
network: string[];
|
|
2769
|
+
/**
|
|
2770
|
+
* Names of the network interface that each {@link ResolvedServerUrls.network}
|
|
2771
|
+
* URL is bound to, in the same order as `network`. An entry is `undefined`
|
|
2772
|
+
* when the interface name is not known, for example when an explicit `host`
|
|
2773
|
+
* is set.
|
|
2774
|
+
*/
|
|
2775
|
+
networkInterfaceNames?: (string | undefined)[];
|
|
2763
2776
|
}
|
|
2764
2777
|
declare function createServer(inlineConfig?: InlineConfig | ResolvedConfig): Promise<ViteDevServer>;
|
|
2765
2778
|
//#endregion
|
|
@@ -2767,13 +2780,13 @@ declare function createServer(inlineConfig?: InlineConfig | ResolvedConfig): Pro
|
|
|
2767
2780
|
interface HtmlTagDescriptor {
|
|
2768
2781
|
tag: string;
|
|
2769
2782
|
/**
|
|
2770
|
-
|
|
2771
|
-
|
|
2783
|
+
* attribute values will be escaped automatically if needed
|
|
2784
|
+
*/
|
|
2772
2785
|
attrs?: Record<string, string | boolean | undefined>;
|
|
2773
2786
|
children?: string | HtmlTagDescriptor[];
|
|
2774
2787
|
/**
|
|
2775
|
-
|
|
2776
|
-
|
|
2788
|
+
* default: 'head-prepend'
|
|
2789
|
+
*/
|
|
2777
2790
|
injectTo?: "head" | "body" | "head-prepend" | "body-prepend";
|
|
2778
2791
|
}
|
|
2779
2792
|
type IndexHtmlTransformResult = string | HtmlTagDescriptor[] | {
|
|
@@ -2782,12 +2795,12 @@ type IndexHtmlTransformResult = string | HtmlTagDescriptor[] | {
|
|
|
2782
2795
|
};
|
|
2783
2796
|
interface IndexHtmlTransformContext {
|
|
2784
2797
|
/**
|
|
2785
|
-
|
|
2786
|
-
|
|
2798
|
+
* public path when served
|
|
2799
|
+
*/
|
|
2787
2800
|
path: string;
|
|
2788
2801
|
/**
|
|
2789
|
-
|
|
2790
|
-
|
|
2802
|
+
* filename on disk
|
|
2803
|
+
*/
|
|
2791
2804
|
filename: string;
|
|
2792
2805
|
server?: ViteDevServer;
|
|
2793
2806
|
bundle?: OutputBundle;
|
|
@@ -2808,35 +2821,35 @@ type StringFilter<Value = string | RegExp> = Value | Array<Value> | {
|
|
|
2808
2821
|
//#endregion
|
|
2809
2822
|
//#region src/node/plugin.d.ts
|
|
2810
2823
|
/**
|
|
2811
|
-
* Vite plugins extends the Rollup plugin interface with a few extra
|
|
2812
|
-
* vite-specific options. A valid vite plugin is also a valid Rollup plugin.
|
|
2813
|
-
* On the contrary, a Rollup plugin may or may NOT be a valid vite universal
|
|
2814
|
-
* plugin, since some Rollup features do not make sense in an unbundled
|
|
2815
|
-
* dev server context. That said, as long as a rollup plugin doesn't have strong
|
|
2816
|
-
* coupling between its bundle phase and output phase hooks then it should
|
|
2817
|
-
* just work (that means, most of them).
|
|
2818
|
-
*
|
|
2819
|
-
* By default, the plugins are run during both serve and build. When a plugin
|
|
2820
|
-
* is applied during serve, it will only run **non output plugin hooks** (see
|
|
2821
|
-
* rollup type definition of {@link rollup#PluginHooks}). You can think of the
|
|
2822
|
-
* dev server as only running `const bundle = rollup.rollup()` but never calling
|
|
2823
|
-
* `bundle.generate()`.
|
|
2824
|
-
*
|
|
2825
|
-
* A plugin that expects to have different behavior depending on serve/build can
|
|
2826
|
-
* export a factory function that receives the command being run via options.
|
|
2827
|
-
*
|
|
2828
|
-
* If a plugin should be applied only for server or build, a function format
|
|
2829
|
-
* config file can be used to conditional determine the plugins to use.
|
|
2830
|
-
*
|
|
2831
|
-
* The current environment can be accessed from the context for the all non-global
|
|
2832
|
-
* hooks (it is not available in config, configResolved, configureServer, etc).
|
|
2833
|
-
* It can be a dev, build, or scan environment.
|
|
2834
|
-
* Plugins can use this.environment.mode === 'dev' to guard for dev specific APIs.
|
|
2835
|
-
*/
|
|
2824
|
+
* Vite plugins extends the Rollup plugin interface with a few extra
|
|
2825
|
+
* vite-specific options. A valid vite plugin is also a valid Rollup plugin.
|
|
2826
|
+
* On the contrary, a Rollup plugin may or may NOT be a valid vite universal
|
|
2827
|
+
* plugin, since some Rollup features do not make sense in an unbundled
|
|
2828
|
+
* dev server context. That said, as long as a rollup plugin doesn't have strong
|
|
2829
|
+
* coupling between its bundle phase and output phase hooks then it should
|
|
2830
|
+
* just work (that means, most of them).
|
|
2831
|
+
*
|
|
2832
|
+
* By default, the plugins are run during both serve and build. When a plugin
|
|
2833
|
+
* is applied during serve, it will only run **non output plugin hooks** (see
|
|
2834
|
+
* rollup type definition of {@link rollup#PluginHooks}). You can think of the
|
|
2835
|
+
* dev server as only running `const bundle = rollup.rollup()` but never calling
|
|
2836
|
+
* `bundle.generate()`.
|
|
2837
|
+
*
|
|
2838
|
+
* A plugin that expects to have different behavior depending on serve/build can
|
|
2839
|
+
* export a factory function that receives the command being run via options.
|
|
2840
|
+
*
|
|
2841
|
+
* If a plugin should be applied only for server or build, a function format
|
|
2842
|
+
* config file can be used to conditional determine the plugins to use.
|
|
2843
|
+
*
|
|
2844
|
+
* The current environment can be accessed from the context for the all non-global
|
|
2845
|
+
* hooks (it is not available in config, configResolved, configureServer, etc).
|
|
2846
|
+
* It can be a dev, build, or scan environment.
|
|
2847
|
+
* Plugins can use this.environment.mode === 'dev' to guard for dev specific APIs.
|
|
2848
|
+
*/
|
|
2836
2849
|
interface PluginContextExtension {
|
|
2837
2850
|
/**
|
|
2838
|
-
|
|
2839
|
-
|
|
2851
|
+
* Vite-specific environment instance
|
|
2852
|
+
*/
|
|
2840
2853
|
environment: Environment;
|
|
2841
2854
|
}
|
|
2842
2855
|
interface PluginContextMetaExtension {
|
|
@@ -2851,37 +2864,37 @@ declare module "rolldown" {
|
|
|
2851
2864
|
interface PluginContextMeta extends PluginContextMetaExtension {}
|
|
2852
2865
|
}
|
|
2853
2866
|
/**
|
|
2854
|
-
* There are two types of plugins in Vite. App plugins and environment plugins.
|
|
2855
|
-
* Environment Plugins are defined by a constructor function that will be called
|
|
2856
|
-
* once per each environment allowing users to have completely different plugins
|
|
2857
|
-
* for each of them. The constructor gets the resolved environment after the server
|
|
2858
|
-
* and builder has already been created simplifying config access and cache
|
|
2859
|
-
* management for environment specific plugins.
|
|
2860
|
-
* Environment Plugins are closer to regular rollup plugins. They can't define
|
|
2861
|
-
* app level hooks (like config, configResolved, configureServer, etc).
|
|
2862
|
-
*/
|
|
2867
|
+
* There are two types of plugins in Vite. App plugins and environment plugins.
|
|
2868
|
+
* Environment Plugins are defined by a constructor function that will be called
|
|
2869
|
+
* once per each environment allowing users to have completely different plugins
|
|
2870
|
+
* for each of them. The constructor gets the resolved environment after the server
|
|
2871
|
+
* and builder has already been created simplifying config access and cache
|
|
2872
|
+
* management for environment specific plugins.
|
|
2873
|
+
* Environment Plugins are closer to regular rollup plugins. They can't define
|
|
2874
|
+
* app level hooks (like config, configResolved, configureServer, etc).
|
|
2875
|
+
*/
|
|
2863
2876
|
interface Plugin<A = any> extends Rolldown.Plugin<A> {
|
|
2864
2877
|
/**
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2878
|
+
* Perform custom handling of HMR updates.
|
|
2879
|
+
* The handler receives an options containing changed filename, timestamp, a
|
|
2880
|
+
* list of modules affected by the file change, and the dev server instance.
|
|
2881
|
+
*
|
|
2882
|
+
* - The hook can return a filtered list of modules to narrow down the update.
|
|
2883
|
+
* e.g. for a Vue SFC, we can narrow down the part to update by comparing
|
|
2884
|
+
* the descriptors.
|
|
2885
|
+
*
|
|
2886
|
+
* - The hook can also return an empty array and then perform custom updates
|
|
2887
|
+
* by sending a custom hmr payload via environment.hot.send().
|
|
2888
|
+
*
|
|
2889
|
+
* - If the hook doesn't return a value, the hmr update will be performed as
|
|
2890
|
+
* normal.
|
|
2891
|
+
*/
|
|
2879
2892
|
hotUpdate?: ObjectHook<(this: MinimalPluginContext & {
|
|
2880
2893
|
environment: DevEnvironment;
|
|
2881
2894
|
}, options: HotUpdateOptions) => Array<EnvironmentModuleNode> | void | Promise<Array<EnvironmentModuleNode> | void>>;
|
|
2882
2895
|
/**
|
|
2883
|
-
|
|
2884
|
-
|
|
2896
|
+
* extend hooks with ssr flag
|
|
2897
|
+
*/
|
|
2885
2898
|
resolveId?: ObjectHook<(this: PluginContext, source: string, importer: string | undefined, options: {
|
|
2886
2899
|
kind?: ImportKind;
|
|
2887
2900
|
custom?: CustomPluginOptions;
|
|
@@ -2911,152 +2924,152 @@ interface Plugin<A = any> extends Rolldown.Plugin<A> {
|
|
|
2911
2924
|
};
|
|
2912
2925
|
}>;
|
|
2913
2926
|
/**
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2927
|
+
* Opt-in this plugin into the shared plugins pipeline.
|
|
2928
|
+
* For backward-compatibility, plugins are re-recreated for each environment
|
|
2929
|
+
* during `vite build --app`
|
|
2930
|
+
* We have an opt-in per plugin, and a general `builder.sharedPlugins`
|
|
2931
|
+
* In a future major, we'll flip the default to be shared by default
|
|
2932
|
+
* @experimental
|
|
2933
|
+
*/
|
|
2921
2934
|
sharedDuringBuild?: boolean;
|
|
2922
2935
|
/**
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2936
|
+
* Opt-in this plugin into per-environment buildStart and buildEnd during dev.
|
|
2937
|
+
* For backward-compatibility, the buildStart hook is called only once during
|
|
2938
|
+
* dev, for the client environment. Plugins can opt-in to be called
|
|
2939
|
+
* per-environment, aligning with the build hook behavior.
|
|
2940
|
+
* @experimental
|
|
2941
|
+
*/
|
|
2929
2942
|
perEnvironmentStartEndDuringDev?: boolean;
|
|
2930
2943
|
/**
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2944
|
+
* Opt-in this plugin into per-environment watchChange during dev.
|
|
2945
|
+
* For backward-compatibility, the watchChange hook is called only once during
|
|
2946
|
+
* dev, for the client environment. Plugins can opt-in to be called
|
|
2947
|
+
* per-environment, aligning with the watchChange hook behavior.
|
|
2948
|
+
* @experimental
|
|
2949
|
+
*/
|
|
2937
2950
|
perEnvironmentWatchChangeDuringDev?: boolean;
|
|
2938
2951
|
/**
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2952
|
+
* Enforce plugin invocation tier similar to webpack loaders. Hooks ordering
|
|
2953
|
+
* is still subject to the `order` property in the hook object.
|
|
2954
|
+
*
|
|
2955
|
+
* Plugin invocation order:
|
|
2956
|
+
* - alias resolution
|
|
2957
|
+
* - `enforce: 'pre'` plugins
|
|
2958
|
+
* - vite core plugins
|
|
2959
|
+
* - normal plugins
|
|
2960
|
+
* - vite build plugins
|
|
2961
|
+
* - `enforce: 'post'` plugins
|
|
2962
|
+
* - vite build post plugins
|
|
2963
|
+
*/
|
|
2951
2964
|
enforce?: "pre" | "post";
|
|
2952
2965
|
/**
|
|
2953
|
-
|
|
2954
|
-
|
|
2966
|
+
* Apply the plugin only for serve or build, or on certain conditions.
|
|
2967
|
+
*/
|
|
2955
2968
|
apply?: "serve" | "build" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean);
|
|
2956
2969
|
/**
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2970
|
+
* Define environments where this plugin should be active
|
|
2971
|
+
* By default, the plugin is active in all environments
|
|
2972
|
+
* @experimental
|
|
2973
|
+
*/
|
|
2961
2974
|
applyToEnvironment?: (environment: PartialEnvironment) => boolean | Promise<boolean> | PluginOption;
|
|
2962
2975
|
/**
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2976
|
+
* Modify vite config before it's resolved. The hook can either mutate the
|
|
2977
|
+
* passed-in config directly, or return a partial config object that will be
|
|
2978
|
+
* deeply merged into existing config.
|
|
2979
|
+
*
|
|
2980
|
+
* Note: User plugins are resolved before running this hook so injecting other
|
|
2981
|
+
* plugins inside the `config` hook will have no effect.
|
|
2982
|
+
*/
|
|
2970
2983
|
config?: ObjectHook<(this: ConfigPluginContext, config: UserConfig, env: ConfigEnv) => Omit<UserConfig, "plugins"> | null | void | Promise<Omit<UserConfig, "plugins"> | null | void>>;
|
|
2971
2984
|
/**
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2985
|
+
* Modify environment configs before it's resolved. The hook can either mutate the
|
|
2986
|
+
* passed-in environment config directly, or return a partial config object that will be
|
|
2987
|
+
* deeply merged into existing config.
|
|
2988
|
+
* This hook is called for each environment with a partially resolved environment config
|
|
2989
|
+
* that already accounts for the default environment config values set at the root level.
|
|
2990
|
+
* If plugins need to modify the config of a given environment, they should do it in this
|
|
2991
|
+
* hook instead of the config hook. Leaving the config hook only for modifying the root
|
|
2992
|
+
* default environment config.
|
|
2993
|
+
*/
|
|
2981
2994
|
configEnvironment?: ObjectHook<(this: ConfigPluginContext, name: string, config: EnvironmentOptions, env: ConfigEnv & {
|
|
2982
2995
|
/**
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2996
|
+
* Whether this environment is SSR environment and `ssr.target` is set to `'webworker'`.
|
|
2997
|
+
* Only intended to be used for backward compatibility.
|
|
2998
|
+
*/
|
|
2986
2999
|
isSsrTargetWebworker?: boolean;
|
|
2987
3000
|
}) => EnvironmentOptions | null | void | Promise<EnvironmentOptions | null | void>>;
|
|
2988
3001
|
/**
|
|
2989
|
-
|
|
2990
|
-
|
|
3002
|
+
* Use this hook to read and store the final resolved vite config.
|
|
3003
|
+
*/
|
|
2991
3004
|
configResolved?: ObjectHook<(this: MinimalPluginContextWithoutEnvironment, config: ResolvedConfig) => void | Promise<void>>;
|
|
2992
3005
|
/**
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3006
|
+
* Configure the vite server. The hook receives the {@link ViteDevServer}
|
|
3007
|
+
* instance. This can also be used to store a reference to the server
|
|
3008
|
+
* for use in other hooks.
|
|
3009
|
+
*
|
|
3010
|
+
* The hooks will be called before internal middlewares are applied. A hook
|
|
3011
|
+
* can return a post hook that will be called after internal middlewares
|
|
3012
|
+
* are applied. Hook can be async functions and will be called in series.
|
|
3013
|
+
*/
|
|
3001
3014
|
configureServer?: ObjectHook<ServerHook>;
|
|
3002
3015
|
/**
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3016
|
+
* Configure the preview server. The hook receives the {@link PreviewServer}
|
|
3017
|
+
* instance. This can also be used to store a reference to the server
|
|
3018
|
+
* for use in other hooks.
|
|
3019
|
+
*
|
|
3020
|
+
* The hooks are called before other middlewares are applied. A hook can
|
|
3021
|
+
* return a post hook that will be called after other middlewares are
|
|
3022
|
+
* applied. Hooks can be async functions and will be called in series.
|
|
3023
|
+
*/
|
|
3011
3024
|
configurePreviewServer?: ObjectHook<PreviewServerHook>;
|
|
3012
3025
|
/**
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3026
|
+
* Transform index.html.
|
|
3027
|
+
* The hook receives the following arguments:
|
|
3028
|
+
*
|
|
3029
|
+
* - html: string
|
|
3030
|
+
* - ctx: IndexHtmlTransformContext, which contains:
|
|
3031
|
+
* - path: public path when served
|
|
3032
|
+
* - filename: filename on disk
|
|
3033
|
+
* - server?: ViteDevServer (only present during serve)
|
|
3034
|
+
* - bundle?: rollup.OutputBundle (only present during build)
|
|
3035
|
+
* - chunk?: rollup.OutputChunk
|
|
3036
|
+
* - originalUrl?: string
|
|
3037
|
+
*
|
|
3038
|
+
* It can either return a transformed string, or a list of html tag
|
|
3039
|
+
* descriptors that will be injected into the `<head>` or `<body>`.
|
|
3040
|
+
*
|
|
3041
|
+
* By default the transform is applied **after** vite's internal html
|
|
3042
|
+
* transform. If you need to apply the transform before vite, use an object:
|
|
3043
|
+
* `{ order: 'pre', handler: hook }`
|
|
3044
|
+
*/
|
|
3032
3045
|
transformIndexHtml?: IndexHtmlTransform;
|
|
3033
3046
|
/**
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3047
|
+
* Build Environments
|
|
3048
|
+
*
|
|
3049
|
+
* @experimental
|
|
3050
|
+
*/
|
|
3038
3051
|
buildApp?: ObjectHook<BuildAppHook>;
|
|
3039
3052
|
/**
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3053
|
+
* Perform custom handling of HMR updates.
|
|
3054
|
+
* The handler receives a context containing changed filename, timestamp, a
|
|
3055
|
+
* list of modules affected by the file change, and the dev server instance.
|
|
3056
|
+
*
|
|
3057
|
+
* - The hook can return a filtered list of modules to narrow down the update.
|
|
3058
|
+
* e.g. for a Vue SFC, we can narrow down the part to update by comparing
|
|
3059
|
+
* the descriptors.
|
|
3060
|
+
*
|
|
3061
|
+
* - The hook can also return an empty array and then perform custom updates
|
|
3062
|
+
* by sending a custom hmr payload via server.ws.send().
|
|
3063
|
+
*
|
|
3064
|
+
* - If the hook doesn't return a value, the hmr update will be performed as
|
|
3065
|
+
* normal.
|
|
3066
|
+
*/
|
|
3054
3067
|
handleHotUpdate?: ObjectHook<(this: MinimalPluginContextWithoutEnvironment, ctx: HmrContext) => Array<ModuleNode> | void | Promise<Array<ModuleNode> | void>>;
|
|
3055
3068
|
/**
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3069
|
+
* This hook is not supported by Rolldown yet. But the type is declared for compatibility.
|
|
3070
|
+
*
|
|
3071
|
+
* @deprecated This hook is **not** deprecated. It is marked as deprecated just to make it clear that this hook is currently a no-op.
|
|
3072
|
+
*/
|
|
3060
3073
|
shouldTransformCachedModule?: ObjectHook<(this: PluginContext, options: {
|
|
3061
3074
|
code: string;
|
|
3062
3075
|
id: string;
|
|
@@ -3065,46 +3078,58 @@ interface Plugin<A = any> extends Rolldown.Plugin<A> {
|
|
|
3065
3078
|
}) => boolean | null | void>;
|
|
3066
3079
|
}
|
|
3067
3080
|
type HookHandler<T> = T extends ObjectHook<infer H> ? H : T;
|
|
3068
|
-
type PluginWithRequiredHook<K extends keyof Plugin> = Plugin & { [P in K]: NonNullable<Plugin[P]
|
|
3081
|
+
type PluginWithRequiredHook<K extends keyof Plugin> = Plugin & { [P in K]: NonNullable<Plugin[P]>; };
|
|
3069
3082
|
type Thenable<T> = T | Promise<T>;
|
|
3070
3083
|
type FalsyPlugin = false | null | undefined;
|
|
3071
3084
|
type PluginOption = Thenable<Plugin | {
|
|
3072
3085
|
name: string;
|
|
3073
3086
|
} | FalsyPlugin | PluginOption[]>;
|
|
3074
3087
|
/**
|
|
3075
|
-
* @experimental
|
|
3076
|
-
*/
|
|
3088
|
+
* @experimental
|
|
3089
|
+
*/
|
|
3077
3090
|
declare function perEnvironmentPlugin(name: string, applyToEnvironment: (environment: PartialEnvironment) => boolean | Promise<boolean> | PluginOption): Plugin;
|
|
3078
3091
|
//#endregion
|
|
3079
3092
|
//#region src/node/idResolver.d.ts
|
|
3080
3093
|
type ResolveIdFn = (environment: PartialEnvironment, id: string, importer?: string, aliasOnly?: boolean) => Promise<string | undefined>;
|
|
3081
3094
|
/**
|
|
3082
|
-
* Create an internal resolver to be used in special scenarios, e.g.
|
|
3083
|
-
* optimizer and handling css @imports
|
|
3084
|
-
*/
|
|
3095
|
+
* Create an internal resolver to be used in special scenarios, e.g.
|
|
3096
|
+
* optimizer and handling css @imports
|
|
3097
|
+
*/
|
|
3085
3098
|
declare function createIdResolver(config: ResolvedConfig, options?: Partial<InternalResolveOptions>): ResolveIdFn;
|
|
3086
3099
|
//#endregion
|
|
3100
|
+
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.7.0_postcss@8.5.20_tsx@4.23.1_yaml@2.9.0/node_modules/postcss-load-config/src/index.d.ts
|
|
3101
|
+
type ConfigPlugin = Transformer | PostCSS.Plugin | Processor;
|
|
3102
|
+
interface Config {
|
|
3103
|
+
parser?: string | ProcessOptions['parser'] | false;
|
|
3104
|
+
stringifier?: string | ProcessOptions['stringifier'] | false;
|
|
3105
|
+
syntax?: string | ProcessOptions['syntax'] | false;
|
|
3106
|
+
map?: string | false;
|
|
3107
|
+
from?: string;
|
|
3108
|
+
to?: string;
|
|
3109
|
+
plugins?: Array<ConfigPlugin | false> | Record<string, object | false>;
|
|
3110
|
+
}
|
|
3111
|
+
//#endregion
|
|
3087
3112
|
//#region src/node/plugins/css.d.ts
|
|
3088
3113
|
interface CSSOptions {
|
|
3089
3114
|
/**
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3115
|
+
* Using lightningcss is an experimental option to handle CSS modules,
|
|
3116
|
+
* assets and imports via Lightning CSS. It requires to install it as a
|
|
3117
|
+
* peer dependency.
|
|
3118
|
+
*
|
|
3119
|
+
* @default 'postcss'
|
|
3120
|
+
* @experimental
|
|
3121
|
+
*/
|
|
3097
3122
|
transformer?: "postcss" | "lightningcss";
|
|
3098
3123
|
/**
|
|
3099
|
-
|
|
3100
|
-
|
|
3124
|
+
* https://github.com/css-modules/postcss-modules
|
|
3125
|
+
*/
|
|
3101
3126
|
modules?: CSSModulesOptions | false;
|
|
3102
3127
|
/**
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3128
|
+
* Options for preprocessors.
|
|
3129
|
+
*
|
|
3130
|
+
* In addition to options specific to each processors, Vite supports `additionalData` option.
|
|
3131
|
+
* The `additionalData` option can be used to inject extra code for each style content.
|
|
3132
|
+
*/
|
|
3108
3133
|
preprocessorOptions?: {
|
|
3109
3134
|
scss?: SassPreprocessorOptions;
|
|
3110
3135
|
sass?: SassPreprocessorOptions;
|
|
@@ -3113,24 +3138,24 @@ interface CSSOptions {
|
|
|
3113
3138
|
stylus?: StylusPreprocessorOptions;
|
|
3114
3139
|
};
|
|
3115
3140
|
/**
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3141
|
+
* If this option is set, preprocessors will run in workers when possible.
|
|
3142
|
+
* `true` means the number of CPUs minus 1.
|
|
3143
|
+
*
|
|
3144
|
+
* @default true
|
|
3145
|
+
*/
|
|
3121
3146
|
preprocessorMaxWorkers?: number | true;
|
|
3122
3147
|
postcss?: string | (PostCSS.ProcessOptions & {
|
|
3123
3148
|
plugins?: PostCSS.AcceptedPlugin[];
|
|
3124
3149
|
});
|
|
3125
3150
|
/**
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3151
|
+
* Enables css sourcemaps during dev
|
|
3152
|
+
* @default false
|
|
3153
|
+
* @experimental
|
|
3154
|
+
*/
|
|
3130
3155
|
devSourcemap?: boolean;
|
|
3131
3156
|
/**
|
|
3132
|
-
|
|
3133
|
-
|
|
3157
|
+
* @experimental
|
|
3158
|
+
*/
|
|
3134
3159
|
lightningcss?: lightningcssOptions_LightningCSSOptions;
|
|
3135
3160
|
}
|
|
3136
3161
|
interface CSSModulesOptions {
|
|
@@ -3141,8 +3166,8 @@ interface CSSModulesOptions {
|
|
|
3141
3166
|
generateScopedName?: string | ((name: string, filename: string, css: string) => string);
|
|
3142
3167
|
hashPrefix?: string;
|
|
3143
3168
|
/**
|
|
3144
|
-
|
|
3145
|
-
|
|
3169
|
+
* default: undefined
|
|
3170
|
+
*/
|
|
3146
3171
|
localsConvention?: "camelCase" | "camelCaseOnly" | "dashes" | "dashesOnly" | ((originalClassName: string, generatedClassName: string, inputFile: string) => string);
|
|
3147
3172
|
}
|
|
3148
3173
|
type ResolvedCSSOptions = Omit<CSSOptions, "lightningcss"> & Required<Pick<CSSOptions, "transformer" | "devSourcemap">> & {
|
|
@@ -3155,8 +3180,8 @@ interface PreprocessCSSResult {
|
|
|
3155
3180
|
deps?: Set<string>;
|
|
3156
3181
|
}
|
|
3157
3182
|
/**
|
|
3158
|
-
* @experimental
|
|
3159
|
-
*/
|
|
3183
|
+
* @experimental
|
|
3184
|
+
*/
|
|
3160
3185
|
declare function preprocessCSS(code: string, filename: string, config: ResolvedConfig): Promise<PreprocessCSSResult>;
|
|
3161
3186
|
declare function formatPostcssSourceMap(rawMap: ExistingRawSourceMap, file: string): Promise<ExistingRawSourceMap>;
|
|
3162
3187
|
type PreprocessorAdditionalDataResult = string | {
|
|
@@ -3180,8 +3205,8 @@ interface ESBuildOptions extends esbuildOptions_EsbuildTransformOptions {
|
|
|
3180
3205
|
exclude?: string | RegExp | ReadonlyArray<string | RegExp>;
|
|
3181
3206
|
jsxInject?: string;
|
|
3182
3207
|
/**
|
|
3183
|
-
|
|
3184
|
-
|
|
3208
|
+
* This option is not respected. Use `build.minify` instead.
|
|
3209
|
+
*/
|
|
3185
3210
|
minify?: never;
|
|
3186
3211
|
}
|
|
3187
3212
|
type ESBuildTransformResult = Omit<EsbuildTransformResult, "map"> & {
|
|
@@ -3192,38 +3217,38 @@ declare function transformWithEsbuild(code: string, filename: string, options?:
|
|
|
3192
3217
|
//#region src/node/plugins/json.d.ts
|
|
3193
3218
|
interface JsonOptions {
|
|
3194
3219
|
/**
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3220
|
+
* Generate a named export for every property of the JSON object
|
|
3221
|
+
* @default true
|
|
3222
|
+
*/
|
|
3198
3223
|
namedExports?: boolean;
|
|
3199
3224
|
/**
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3225
|
+
* Generate performant output as JSON.parse("stringified").
|
|
3226
|
+
*
|
|
3227
|
+
* When set to 'auto', the data will be stringified only if the data is bigger than 10kB.
|
|
3228
|
+
* @default 'auto'
|
|
3229
|
+
*/
|
|
3205
3230
|
stringify?: boolean | "auto";
|
|
3206
3231
|
}
|
|
3207
3232
|
//#endregion
|
|
3208
3233
|
//#region src/node/assetSource.d.ts
|
|
3209
3234
|
/**
|
|
3210
|
-
* Defines which attributes of an HTML element should be treated as asset sources.
|
|
3211
|
-
* Used in `html.additionalAssetSources` configuration.
|
|
3212
|
-
*/
|
|
3235
|
+
* Defines which attributes of an HTML element should be treated as asset sources.
|
|
3236
|
+
* Used in `html.additionalAssetSources` configuration.
|
|
3237
|
+
*/
|
|
3213
3238
|
interface HtmlAssetSource {
|
|
3214
3239
|
/**
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3240
|
+
* Attributes that contain a single asset URL.
|
|
3241
|
+
* @example ['src', 'data-src-dark']
|
|
3242
|
+
*/
|
|
3218
3243
|
srcAttributes?: string[];
|
|
3219
3244
|
/**
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3245
|
+
* Attributes that contain srcset-format URLs.
|
|
3246
|
+
* @example ['srcset', 'imagesrcset']
|
|
3247
|
+
*/
|
|
3223
3248
|
srcsetAttributes?: string[];
|
|
3224
3249
|
/**
|
|
3225
|
-
|
|
3226
|
-
|
|
3250
|
+
* Called before handling an attribute to determine if it should be processed.
|
|
3251
|
+
*/
|
|
3227
3252
|
filter?: (data: HtmlAssetSourceFilterData) => boolean;
|
|
3228
3253
|
}
|
|
3229
3254
|
interface HtmlAssetSourceFilterData {
|
|
@@ -3239,35 +3264,35 @@ interface SSROptions {
|
|
|
3239
3264
|
noExternal?: string | RegExp | (string | RegExp)[] | true;
|
|
3240
3265
|
external?: string[] | true;
|
|
3241
3266
|
/**
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3267
|
+
* Define the target for the ssr build. The browser field in package.json
|
|
3268
|
+
* is ignored for node but used if webworker is the target
|
|
3269
|
+
* This option will be removed in a future major version
|
|
3270
|
+
* @default 'node'
|
|
3271
|
+
*/
|
|
3247
3272
|
target?: SSRTarget;
|
|
3248
3273
|
/**
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3274
|
+
* Control over which dependencies are optimized during SSR and esbuild options
|
|
3275
|
+
* During build:
|
|
3276
|
+
* no external CJS dependencies are optimized by default
|
|
3277
|
+
* During dev:
|
|
3278
|
+
* explicit no external CJS dependencies are optimized by default
|
|
3279
|
+
* @experimental
|
|
3280
|
+
*/
|
|
3256
3281
|
optimizeDeps?: SsrDepOptimizationConfig;
|
|
3257
3282
|
resolve?: {
|
|
3258
3283
|
/**
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3284
|
+
* Conditions that are used in the plugin pipeline. The default value is the root config's `resolve.conditions`.
|
|
3285
|
+
*
|
|
3286
|
+
* Use this to override the default ssr conditions for the ssr build.
|
|
3287
|
+
*
|
|
3288
|
+
* @default rootConfig.resolve.conditions
|
|
3289
|
+
*/
|
|
3265
3290
|
conditions?: string[];
|
|
3266
3291
|
/**
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3292
|
+
* Conditions that are used during ssr import (including `ssrLoadModule`) of externalized dependencies.
|
|
3293
|
+
*
|
|
3294
|
+
* @default ['node', 'module-sync']
|
|
3295
|
+
*/
|
|
3271
3296
|
externalConditions?: string[];
|
|
3272
3297
|
mainFields?: string[];
|
|
3273
3298
|
};
|
|
@@ -3290,31 +3315,31 @@ declare function transformWithOxc(code: string, filename: string, options?: roll
|
|
|
3290
3315
|
//#region src/node/config.d.ts
|
|
3291
3316
|
interface ConfigEnv {
|
|
3292
3317
|
/**
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3318
|
+
* 'serve': during dev (`vite` command)
|
|
3319
|
+
* 'build': when building for production (`vite build` command)
|
|
3320
|
+
*/
|
|
3296
3321
|
command: "build" | "serve";
|
|
3297
3322
|
mode: string;
|
|
3298
3323
|
isSsrBuild?: boolean;
|
|
3299
3324
|
isPreview?: boolean;
|
|
3300
3325
|
}
|
|
3301
3326
|
/**
|
|
3302
|
-
* spa: include SPA fallback middleware and configure sirv with `single: true` in preview
|
|
3303
|
-
*
|
|
3304
|
-
* mpa: only include non-SPA HTML middlewares
|
|
3305
|
-
*
|
|
3306
|
-
* custom: don't include HTML middlewares
|
|
3307
|
-
*/
|
|
3327
|
+
* spa: include SPA fallback middleware and configure sirv with `single: true` in preview
|
|
3328
|
+
*
|
|
3329
|
+
* mpa: only include non-SPA HTML middlewares
|
|
3330
|
+
*
|
|
3331
|
+
* custom: don't include HTML middlewares
|
|
3332
|
+
*/
|
|
3308
3333
|
type AppType = "spa" | "mpa" | "custom";
|
|
3309
3334
|
type UserConfigFnObject = (env: ConfigEnv) => UserConfig;
|
|
3310
3335
|
type UserConfigFnPromise = (env: ConfigEnv) => Promise<UserConfig>;
|
|
3311
3336
|
type UserConfigFn = (env: ConfigEnv) => UserConfig | Promise<UserConfig>;
|
|
3312
3337
|
type UserConfigExport = UserConfig | Promise<UserConfig> | UserConfigFnObject | UserConfigFnPromise | UserConfigFn;
|
|
3313
3338
|
/**
|
|
3314
|
-
* Type helper to make it easier to use vite.config.ts
|
|
3315
|
-
* accepts a direct {@link UserConfig} object, or a function that returns it.
|
|
3316
|
-
* The function receives a {@link ConfigEnv} object.
|
|
3317
|
-
*/
|
|
3339
|
+
* Type helper to make it easier to use vite.config.ts
|
|
3340
|
+
* accepts a direct {@link UserConfig} object, or a function that returns it.
|
|
3341
|
+
* The function receives a {@link ConfigEnv} object.
|
|
3342
|
+
*/
|
|
3318
3343
|
declare function defineConfig(config: UserConfig): UserConfig;
|
|
3319
3344
|
declare function defineConfig(config: Promise<UserConfig>): Promise<UserConfig>;
|
|
3320
3345
|
declare function defineConfig(config: UserConfigFnObject): UserConfigFnObject;
|
|
@@ -3326,48 +3351,48 @@ interface CreateDevEnvironmentContext {
|
|
|
3326
3351
|
}
|
|
3327
3352
|
interface DevEnvironmentOptions {
|
|
3328
3353
|
/**
|
|
3329
|
-
|
|
3330
|
-
|
|
3354
|
+
* Files to be pre-transformed. Supports glob patterns.
|
|
3355
|
+
*/
|
|
3331
3356
|
warmup?: string[];
|
|
3332
3357
|
/**
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3358
|
+
* Pre-transform known direct imports
|
|
3359
|
+
* defaults to true for the client environment, false for the rest
|
|
3360
|
+
*/
|
|
3336
3361
|
preTransformRequests?: boolean;
|
|
3337
3362
|
/**
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3363
|
+
* Enables sourcemaps during dev
|
|
3364
|
+
* @default { js: true }
|
|
3365
|
+
* @experimental
|
|
3366
|
+
*/
|
|
3342
3367
|
sourcemap?: boolean | {
|
|
3343
3368
|
js?: boolean;
|
|
3344
3369
|
css?: boolean;
|
|
3345
3370
|
};
|
|
3346
3371
|
/**
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3372
|
+
* Whether or not to ignore-list source files in the dev server sourcemap, used to populate
|
|
3373
|
+
* the [`x_google_ignoreList` source map extension](https://developer.chrome.com/blog/devtools-better-angular-debugging/#the-x_google_ignorelist-source-map-extension).
|
|
3374
|
+
*
|
|
3375
|
+
* By default, it excludes all paths containing `node_modules`. You can pass `false` to
|
|
3376
|
+
* disable this behavior, or, for full control, a function that takes the source path and
|
|
3377
|
+
* sourcemap path and returns whether to ignore the source path.
|
|
3378
|
+
*/
|
|
3354
3379
|
sourcemapIgnoreList?: false | ((sourcePath: string, sourcemapPath: string) => boolean);
|
|
3355
3380
|
/**
|
|
3356
|
-
|
|
3357
|
-
|
|
3381
|
+
* create the Dev Environment instance
|
|
3382
|
+
*/
|
|
3358
3383
|
createEnvironment?: (name: string, config: ResolvedConfig, context: CreateDevEnvironmentContext) => Promise<DevEnvironment> | DevEnvironment;
|
|
3359
3384
|
/**
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3385
|
+
* For environments that support a full-reload, like the client, we can short-circuit when
|
|
3386
|
+
* restarting the server throwing early to stop processing current files. We avoided this for
|
|
3387
|
+
* SSR requests. Maybe this is no longer needed.
|
|
3388
|
+
* @experimental
|
|
3389
|
+
*/
|
|
3365
3390
|
recoverable?: boolean;
|
|
3366
3391
|
/**
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3392
|
+
* For environments associated with a module runner.
|
|
3393
|
+
* By default, it is false for the client environment and true for non-client environments.
|
|
3394
|
+
* This option can also be used instead of the removed config.experimental.skipSsrTransform.
|
|
3395
|
+
*/
|
|
3371
3396
|
moduleRunnerTransform?: boolean;
|
|
3372
3397
|
}
|
|
3373
3398
|
type ResolvedDevEnvironmentOptions = Omit<Required<DevEnvironmentOptions>, "sourcemapIgnoreList"> & {
|
|
@@ -3378,52 +3403,59 @@ type AllResolveOptions = ResolveOptions & {
|
|
|
3378
3403
|
};
|
|
3379
3404
|
interface SharedEnvironmentOptions {
|
|
3380
3405
|
/**
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3406
|
+
* Entry points of the application.
|
|
3407
|
+
*
|
|
3408
|
+
* Paths are resolved relative to the project root.
|
|
3409
|
+
*/
|
|
3410
|
+
input?: InputOption;
|
|
3411
|
+
/**
|
|
3412
|
+
* Define global variable replacements.
|
|
3413
|
+
* Entries will be defined on `window` during dev and replaced during build.
|
|
3414
|
+
*/
|
|
3384
3415
|
define?: Record<string, any>;
|
|
3385
3416
|
/**
|
|
3386
|
-
|
|
3387
|
-
|
|
3417
|
+
* Configure resolver
|
|
3418
|
+
*/
|
|
3388
3419
|
resolve?: EnvironmentResolveOptions;
|
|
3389
3420
|
/**
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3421
|
+
* Define if this environment is used for Server-Side Rendering
|
|
3422
|
+
* @default 'server' if it isn't the client environment
|
|
3423
|
+
*/
|
|
3393
3424
|
consumer?: "client" | "server";
|
|
3394
3425
|
/**
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3426
|
+
* If true, `process.env` referenced in code will be preserved as-is and evaluated in runtime.
|
|
3427
|
+
* Otherwise, it is statically replaced as an empty object.
|
|
3428
|
+
*/
|
|
3398
3429
|
keepProcessEnv?: boolean;
|
|
3399
3430
|
/**
|
|
3400
|
-
|
|
3401
|
-
|
|
3431
|
+
* Optimize deps config
|
|
3432
|
+
*/
|
|
3402
3433
|
optimizeDeps?: DepOptimizationOptions;
|
|
3403
3434
|
/**
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3435
|
+
* Whether this environment produces a bundled output.
|
|
3436
|
+
*
|
|
3437
|
+
* During `build`, this defaults to `true` for every environment.
|
|
3438
|
+
* During `serve`, this defaults to `true` only for the client environment
|
|
3439
|
+
* when `experimental.bundledDev` is enabled, and `false` otherwise.
|
|
3440
|
+
* Setting this explicitly on an environment always overrides the default.
|
|
3441
|
+
*
|
|
3442
|
+
* @experimental
|
|
3443
|
+
*/
|
|
3413
3444
|
isBundled?: boolean;
|
|
3414
3445
|
}
|
|
3415
3446
|
interface EnvironmentOptions extends SharedEnvironmentOptions {
|
|
3416
3447
|
/**
|
|
3417
|
-
|
|
3418
|
-
|
|
3448
|
+
* Dev specific options
|
|
3449
|
+
*/
|
|
3419
3450
|
dev?: DevEnvironmentOptions;
|
|
3420
3451
|
/**
|
|
3421
|
-
|
|
3422
|
-
|
|
3452
|
+
* Build specific options
|
|
3453
|
+
*/
|
|
3423
3454
|
build?: BuildEnvironmentOptions;
|
|
3424
3455
|
}
|
|
3425
3456
|
type ResolvedResolveOptions = Required<ResolveOptions>;
|
|
3426
3457
|
type ResolvedEnvironmentOptions = {
|
|
3458
|
+
input?: InputOption;
|
|
3427
3459
|
define?: Record<string, any>;
|
|
3428
3460
|
resolve: ResolvedResolveOptions;
|
|
3429
3461
|
consumer: "client" | "server";
|
|
@@ -3439,205 +3471,205 @@ type DefaultEnvironmentOptions = Omit<EnvironmentOptions, "consumer" | "resolve"
|
|
|
3439
3471
|
};
|
|
3440
3472
|
interface UserConfig extends DefaultEnvironmentOptions {
|
|
3441
3473
|
/**
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3474
|
+
* Project root directory. Can be an absolute path, or a path relative from
|
|
3475
|
+
* the location of the config file itself.
|
|
3476
|
+
* @default process.cwd()
|
|
3477
|
+
*/
|
|
3446
3478
|
root?: string;
|
|
3447
3479
|
/**
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3480
|
+
* Base public path when served in development or production.
|
|
3481
|
+
* @default '/'
|
|
3482
|
+
*/
|
|
3451
3483
|
base?: string;
|
|
3452
3484
|
/**
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3485
|
+
* Directory to serve as plain static assets. Files in this directory are
|
|
3486
|
+
* served and copied to build dist dir as-is without transform. The value
|
|
3487
|
+
* can be either an absolute file system path or a path relative to project root.
|
|
3488
|
+
*
|
|
3489
|
+
* Set to `false` or an empty string to disable copied static assets to build dist dir.
|
|
3490
|
+
* @default 'public'
|
|
3491
|
+
*/
|
|
3460
3492
|
publicDir?: string | false;
|
|
3461
3493
|
/**
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3494
|
+
* Directory to save cache files. Files in this directory are pre-bundled
|
|
3495
|
+
* deps or some other cache files that generated by vite, which can improve
|
|
3496
|
+
* the performance. You can use `--force` flag or manually delete the directory
|
|
3497
|
+
* to regenerate the cache files. The value can be either an absolute file
|
|
3498
|
+
* system path or a path relative to project root.
|
|
3499
|
+
* Default to `.vite` when no `package.json` is detected.
|
|
3500
|
+
* @default 'node_modules/.vite'
|
|
3501
|
+
*/
|
|
3470
3502
|
cacheDir?: string;
|
|
3471
3503
|
/**
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3504
|
+
* Explicitly set a mode to run in. This will override the default mode for
|
|
3505
|
+
* each command, and can be overridden by the command line --mode option.
|
|
3506
|
+
*/
|
|
3475
3507
|
mode?: string;
|
|
3476
3508
|
/**
|
|
3477
|
-
|
|
3478
|
-
|
|
3509
|
+
* Array of vite plugins to use.
|
|
3510
|
+
*/
|
|
3479
3511
|
plugins?: PluginOption[];
|
|
3480
3512
|
/**
|
|
3481
|
-
|
|
3482
|
-
|
|
3513
|
+
* HTML related options
|
|
3514
|
+
*/
|
|
3483
3515
|
html?: HTMLOptions;
|
|
3484
3516
|
/**
|
|
3485
|
-
|
|
3486
|
-
|
|
3517
|
+
* CSS related options (preprocessors and CSS modules)
|
|
3518
|
+
*/
|
|
3487
3519
|
css?: CSSOptions;
|
|
3488
3520
|
/**
|
|
3489
|
-
|
|
3490
|
-
|
|
3521
|
+
* JSON loading options
|
|
3522
|
+
*/
|
|
3491
3523
|
json?: JsonOptions;
|
|
3492
3524
|
/**
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3525
|
+
* Transform options to pass to esbuild.
|
|
3526
|
+
* Or set to `false` to disable esbuild.
|
|
3527
|
+
*
|
|
3528
|
+
* @deprecated Use `oxc` option instead.
|
|
3529
|
+
*/
|
|
3498
3530
|
esbuild?: ESBuildOptions | false;
|
|
3499
3531
|
/**
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3532
|
+
* Transform options to pass to Oxc.
|
|
3533
|
+
* Or set to `false` to disable Oxc.
|
|
3534
|
+
*/
|
|
3503
3535
|
oxc?: OxcOptions | false;
|
|
3504
3536
|
/**
|
|
3505
|
-
|
|
3506
|
-
|
|
3537
|
+
* Specify additional picomatch patterns to be treated as static assets.
|
|
3538
|
+
*/
|
|
3507
3539
|
assetsInclude?: string | RegExp | (string | RegExp)[];
|
|
3508
3540
|
/**
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3541
|
+
* Builder specific options
|
|
3542
|
+
* @experimental
|
|
3543
|
+
*/
|
|
3512
3544
|
builder?: BuilderOptions;
|
|
3513
3545
|
/**
|
|
3514
|
-
|
|
3515
|
-
|
|
3546
|
+
* Server specific options, e.g. host, port, https...
|
|
3547
|
+
*/
|
|
3516
3548
|
server?: ServerOptions$1;
|
|
3517
3549
|
/**
|
|
3518
|
-
|
|
3519
|
-
|
|
3550
|
+
* Preview specific options, e.g. host, port, https...
|
|
3551
|
+
*/
|
|
3520
3552
|
preview?: PreviewOptions;
|
|
3521
3553
|
/**
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3554
|
+
* Experimental features
|
|
3555
|
+
*
|
|
3556
|
+
* Features under this field could change in the future and might NOT follow semver.
|
|
3557
|
+
* Please be careful and always pin Vite's version when using them.
|
|
3558
|
+
* @experimental
|
|
3559
|
+
*/
|
|
3528
3560
|
experimental?: ExperimentalOptions;
|
|
3529
3561
|
/**
|
|
3530
|
-
|
|
3531
|
-
|
|
3562
|
+
* Options to opt-in to future behavior
|
|
3563
|
+
*/
|
|
3532
3564
|
future?: FutureOptions | "warn";
|
|
3533
3565
|
/**
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3566
|
+
* Legacy options
|
|
3567
|
+
*
|
|
3568
|
+
* Features under this field only follow semver for patches, they could be removed in a
|
|
3569
|
+
* future minor version. Please always pin Vite's version to a minor when using them.
|
|
3570
|
+
*/
|
|
3539
3571
|
legacy?: LegacyOptions;
|
|
3540
3572
|
/**
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3573
|
+
* Log level.
|
|
3574
|
+
* @default 'info'
|
|
3575
|
+
*/
|
|
3544
3576
|
logLevel?: LogLevel;
|
|
3545
3577
|
/**
|
|
3546
|
-
|
|
3547
|
-
|
|
3578
|
+
* Custom logger.
|
|
3579
|
+
*/
|
|
3548
3580
|
customLogger?: Logger;
|
|
3549
3581
|
/**
|
|
3550
|
-
|
|
3551
|
-
|
|
3582
|
+
* @default true
|
|
3583
|
+
*/
|
|
3552
3584
|
clearScreen?: boolean;
|
|
3553
3585
|
/**
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3586
|
+
* Environment files directory. Can be an absolute path, or a path relative from
|
|
3587
|
+
* root.
|
|
3588
|
+
* @default root
|
|
3589
|
+
*/
|
|
3558
3590
|
envDir?: string | false;
|
|
3559
3591
|
/**
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3592
|
+
* Env variables starts with `envPrefix` will be exposed to your client source code via import.meta.env.
|
|
3593
|
+
* @default 'VITE_'
|
|
3594
|
+
*/
|
|
3563
3595
|
envPrefix?: string | string[];
|
|
3564
3596
|
/**
|
|
3565
|
-
|
|
3566
|
-
|
|
3597
|
+
* Worker bundle options
|
|
3598
|
+
*/
|
|
3567
3599
|
worker?: {
|
|
3568
3600
|
/**
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3601
|
+
* Output format for worker bundle
|
|
3602
|
+
* @default 'iife'
|
|
3603
|
+
*/
|
|
3572
3604
|
format?: "es" | "iife";
|
|
3573
3605
|
/**
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3606
|
+
* Vite plugins that apply to worker bundle. The plugins returned by this function
|
|
3607
|
+
* should be new instances every time it is called, because they are used for each
|
|
3608
|
+
* rolldown worker bundling process.
|
|
3609
|
+
*/
|
|
3578
3610
|
plugins?: () => PluginOption[];
|
|
3579
3611
|
/**
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3612
|
+
* Alias to `rolldownOptions`.
|
|
3613
|
+
* @deprecated Use `rolldownOptions` instead.
|
|
3614
|
+
*/
|
|
3583
3615
|
rollupOptions?: Omit<RolldownOptions, "plugins" | "input" | "onwarn" | "preserveEntrySignatures">;
|
|
3584
3616
|
/**
|
|
3585
|
-
|
|
3586
|
-
|
|
3617
|
+
* Rolldown options to build worker bundle
|
|
3618
|
+
*/
|
|
3587
3619
|
rolldownOptions?: Omit<RolldownOptions, "plugins" | "input" | "onwarn" | "preserveEntrySignatures">;
|
|
3588
3620
|
};
|
|
3589
3621
|
/**
|
|
3590
|
-
|
|
3591
|
-
|
|
3622
|
+
* Dep optimization options
|
|
3623
|
+
*/
|
|
3592
3624
|
optimizeDeps?: DepOptimizationOptions;
|
|
3593
3625
|
/**
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3626
|
+
* SSR specific options
|
|
3627
|
+
* We could make SSROptions be a EnvironmentOptions if we can abstract
|
|
3628
|
+
* external/noExternal for environments in general.
|
|
3629
|
+
*/
|
|
3598
3630
|
ssr?: SSROptions;
|
|
3599
3631
|
/**
|
|
3600
|
-
|
|
3601
|
-
|
|
3632
|
+
* Environment overrides
|
|
3633
|
+
*/
|
|
3602
3634
|
environments?: Record<string, EnvironmentOptions>;
|
|
3603
3635
|
/**
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3636
|
+
* Whether your application is a Single Page Application (SPA),
|
|
3637
|
+
* a Multi-Page Application (MPA), or Custom Application (SSR
|
|
3638
|
+
* and frameworks with custom HTML handling)
|
|
3639
|
+
* @default 'spa'
|
|
3640
|
+
*/
|
|
3609
3641
|
appType?: AppType;
|
|
3610
3642
|
/**
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3643
|
+
* Enable devtools integration. Ensure that `@vitejs/devtools` is installed as a dependency.
|
|
3644
|
+
* This feature is currently supported only in build mode.
|
|
3645
|
+
* @experimental
|
|
3646
|
+
* @default false
|
|
3647
|
+
*/
|
|
3616
3648
|
devtools?: boolean | DevToolsConfig;
|
|
3617
3649
|
}
|
|
3618
3650
|
interface HTMLOptions {
|
|
3619
3651
|
/**
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3652
|
+
* A nonce value placeholder that will be used when generating script/style tags.
|
|
3653
|
+
*
|
|
3654
|
+
* Make sure that this placeholder will be replaced with a unique value for each request by the server.
|
|
3655
|
+
*/
|
|
3624
3656
|
cspNonce?: string;
|
|
3625
3657
|
/**
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3658
|
+
* Define additional HTML elements and attributes to be treated as asset sources.
|
|
3659
|
+
* This extends the built-in list that includes standard elements like `<img src>`, `<video src>`, etc.
|
|
3660
|
+
*
|
|
3661
|
+
* @example
|
|
3662
|
+
* ```ts
|
|
3663
|
+
* html: {
|
|
3664
|
+
* additionalAssetSources: {
|
|
3665
|
+
* // Custom web component
|
|
3666
|
+
* 'html-import': { srcAttributes: ['src'] },
|
|
3667
|
+
* // Add data-* attributes to existing element
|
|
3668
|
+
* 'img': { srcAttributes: ['data-src-dark', 'data-src-light'] }
|
|
3669
|
+
* }
|
|
3670
|
+
* }
|
|
3671
|
+
* ```
|
|
3672
|
+
*/
|
|
3641
3673
|
additionalAssetSources?: Record<string, HtmlAssetSource>;
|
|
3642
3674
|
}
|
|
3643
3675
|
interface FutureOptions {
|
|
@@ -3653,70 +3685,78 @@ interface FutureOptions {
|
|
|
3653
3685
|
}
|
|
3654
3686
|
interface ExperimentalOptions {
|
|
3655
3687
|
/**
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3688
|
+
* Append fake `&lang.(ext)` when queries are specified, to preserve the file extension for following plugins to process.
|
|
3689
|
+
*
|
|
3690
|
+
* @experimental
|
|
3691
|
+
* @default false
|
|
3692
|
+
*/
|
|
3661
3693
|
importGlobRestoreExtension?: boolean;
|
|
3662
3694
|
/**
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3695
|
+
* Allow finegrain control over assets and public files paths
|
|
3696
|
+
*
|
|
3697
|
+
* @experimental
|
|
3698
|
+
*/
|
|
3667
3699
|
renderBuiltUrl?: RenderBuiltAssetUrl;
|
|
3668
3700
|
/**
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3701
|
+
* Enables support of HMR partial accept via `import.meta.hot.acceptExports`.
|
|
3702
|
+
*
|
|
3703
|
+
* @experimental
|
|
3704
|
+
* @default false
|
|
3705
|
+
*/
|
|
3674
3706
|
hmrPartialAccept?: boolean;
|
|
3675
3707
|
/**
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3708
|
+
* Enable full bundle mode during `serve`.
|
|
3709
|
+
*
|
|
3710
|
+
* This seeds the default for the client environment's `isBundled` option.
|
|
3711
|
+
* Other environments default to `false` during `serve`. Any environment
|
|
3712
|
+
* can override its `isBundled` value via `environments[name].isBundled`.
|
|
3713
|
+
*
|
|
3714
|
+
* This is highly experimental.
|
|
3715
|
+
*
|
|
3716
|
+
* HMR semantics under full bundle mode differ from the middleware-based dev server
|
|
3717
|
+
* in two ways (boundaries are computed in the browser from runtime state, not
|
|
3718
|
+
* statically on the server):
|
|
3719
|
+
*
|
|
3720
|
+
* - Acceptance counts only when it executed: an `import.meta.hot.accept()` that
|
|
3721
|
+
* is in a dead branch does not suppress the update and falls back to a full reload.
|
|
3722
|
+
* - `hot.invalidate()` is handled fully client-side.
|
|
3723
|
+
*
|
|
3724
|
+
* @experimental
|
|
3725
|
+
* @default false
|
|
3726
|
+
*/
|
|
3687
3727
|
bundledDev?: boolean;
|
|
3688
3728
|
}
|
|
3689
3729
|
interface LegacyOptions {
|
|
3690
3730
|
/**
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3731
|
+
* In Vite 6.0.8 and below, WebSocket server was able to connect from any web pages. However,
|
|
3732
|
+
* that could be exploited by a malicious web page.
|
|
3733
|
+
*
|
|
3734
|
+
* In Vite 6.0.9+, the WebSocket server now requires a token to connect from a web page.
|
|
3735
|
+
* But this may break some plugins and frameworks that connects to the WebSocket server
|
|
3736
|
+
* on their own. Enabling this option will make Vite skip the token check.
|
|
3737
|
+
*
|
|
3738
|
+
* **We do not recommend enabling this option unless you are sure that you are fine with
|
|
3739
|
+
* that security weakness.**
|
|
3740
|
+
*/
|
|
3701
3741
|
skipWebSocketTokenCheck?: boolean;
|
|
3702
3742
|
/**
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3743
|
+
* Opt-in to the pre-Vite 8 CJS interop behavior, which was inconsistent.
|
|
3744
|
+
*
|
|
3745
|
+
* In pre-Vite 8 versions, Vite had inconsistent CJS interop behavior. This was due to
|
|
3746
|
+
* the different behavior of esbuild and the Rollup commonjs plugin.
|
|
3747
|
+
* Vite 8+ uses Rolldown for both the dependency optimization in dev and the production build,
|
|
3748
|
+
* which aligns the behavior to esbuild.
|
|
3749
|
+
*
|
|
3750
|
+
* See the Vite 8 migration guide for more details.
|
|
3751
|
+
*/
|
|
3712
3752
|
inconsistentCjsInterop?: boolean;
|
|
3713
3753
|
}
|
|
3714
3754
|
interface ResolvedWorkerOptions {
|
|
3715
3755
|
format: "es" | "iife";
|
|
3716
3756
|
plugins: (bundleChain: string[]) => Promise<ResolvedConfig>;
|
|
3717
3757
|
/**
|
|
3718
|
-
|
|
3719
|
-
|
|
3758
|
+
* @deprecated Use `rolldownOptions` instead.
|
|
3759
|
+
*/
|
|
3720
3760
|
rollupOptions: RolldownOptions;
|
|
3721
3761
|
rolldownOptions: RolldownOptions;
|
|
3722
3762
|
}
|
|
@@ -3747,11 +3787,13 @@ interface ResolvedConfig extends Readonly<Omit<UserConfig, "plugins" | "css" | "
|
|
|
3747
3787
|
};
|
|
3748
3788
|
plugins: readonly Plugin[];
|
|
3749
3789
|
css: ResolvedCSSOptions;
|
|
3750
|
-
json: Required<JsonOptions>;
|
|
3790
|
+
json: Required<JsonOptions>;
|
|
3791
|
+
/** @deprecated Use `oxc` option instead. */
|
|
3751
3792
|
esbuild: ESBuildOptions | false;
|
|
3752
3793
|
oxc: OxcOptions | false;
|
|
3753
3794
|
server: ResolvedServerOptions;
|
|
3754
|
-
dev: ResolvedDevEnvironmentOptions;
|
|
3795
|
+
dev: ResolvedDevEnvironmentOptions;
|
|
3796
|
+
/** @experimental */
|
|
3755
3797
|
builder: ResolvedBuilderOptions | undefined;
|
|
3756
3798
|
build: ResolvedBuildOptions;
|
|
3757
3799
|
devtools: ResolvedDevToolsConfig;
|
|
@@ -3761,15 +3803,15 @@ interface ResolvedConfig extends Readonly<Omit<UserConfig, "plugins" | "css" | "
|
|
|
3761
3803
|
rawAssetsInclude: (string | RegExp)[];
|
|
3762
3804
|
logger: Logger;
|
|
3763
3805
|
/**
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3806
|
+
* Create an internal resolver to be used in special scenarios, e.g.
|
|
3807
|
+
* optimizer & handling css `@imports`.
|
|
3808
|
+
*
|
|
3809
|
+
* This API is deprecated. It only works for the client and ssr
|
|
3810
|
+
* environments. The `aliasOnly` option is also not being used anymore.
|
|
3811
|
+
* Plugins should move to `createIdResolver(environment.config)` instead.
|
|
3812
|
+
*
|
|
3813
|
+
* @deprecated Use `createIdResolver` from `vite` instead.
|
|
3814
|
+
*/
|
|
3773
3815
|
createResolver: (options?: Partial<InternalResolveOptions>) => ResolveFn;
|
|
3774
3816
|
optimizeDeps: DepOptimizationOptions;
|
|
3775
3817
|
worker: ResolvedWorkerOptions;
|
|
@@ -3778,15 +3820,15 @@ interface ResolvedConfig extends Readonly<Omit<UserConfig, "plugins" | "css" | "
|
|
|
3778
3820
|
future: FutureOptions | undefined;
|
|
3779
3821
|
environments: Record<string, ResolvedEnvironmentOptions>;
|
|
3780
3822
|
/**
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3823
|
+
* The token to connect to the WebSocket server from browsers.
|
|
3824
|
+
*
|
|
3825
|
+
* We recommend using `import.meta.hot` rather than connecting
|
|
3826
|
+
* to the WebSocket server directly.
|
|
3827
|
+
* If you have a usecase that requires connecting to the WebSocket
|
|
3828
|
+
* server, please create an issue so that we can discuss.
|
|
3829
|
+
*
|
|
3830
|
+
* @deprecated
|
|
3831
|
+
*/
|
|
3790
3832
|
webSocketToken: string;
|
|
3791
3833
|
} & PluginHookUtils> {}
|
|
3792
3834
|
interface PluginHookUtils {
|
|
@@ -3807,27 +3849,27 @@ declare function buildErrorMessage(err: RollupError, args?: string[], includeSta
|
|
|
3807
3849
|
//#endregion
|
|
3808
3850
|
//#region src/node/ssr/runtime/serverModuleRunner.d.ts
|
|
3809
3851
|
/**
|
|
3810
|
-
* @experimental
|
|
3811
|
-
*/
|
|
3852
|
+
* @experimental
|
|
3853
|
+
*/
|
|
3812
3854
|
interface ServerModuleRunnerOptions extends Omit<ModuleRunnerOptions, "root" | "fetchModule" | "hmr" | "transport"> {
|
|
3813
3855
|
/**
|
|
3814
|
-
|
|
3815
|
-
|
|
3856
|
+
* Disable HMR or configure HMR logger.
|
|
3857
|
+
*/
|
|
3816
3858
|
hmr?: false | {
|
|
3817
3859
|
logger?: ModuleRunnerHmr["logger"];
|
|
3818
3860
|
};
|
|
3819
3861
|
/**
|
|
3820
|
-
|
|
3821
|
-
|
|
3862
|
+
* Provide a custom module evaluator. This controls how the code is executed.
|
|
3863
|
+
*/
|
|
3822
3864
|
evaluator?: ModuleEvaluator;
|
|
3823
3865
|
}
|
|
3824
3866
|
declare const createServerModuleRunnerTransport: (options: {
|
|
3825
3867
|
channel: NormalizedServerHotChannel;
|
|
3826
3868
|
}) => ModuleRunnerTransport;
|
|
3827
3869
|
/**
|
|
3828
|
-
* Create an instance of the Vite SSR runtime that support HMR.
|
|
3829
|
-
* @experimental
|
|
3830
|
-
*/
|
|
3870
|
+
* Create an instance of the Vite SSR runtime that support HMR.
|
|
3871
|
+
* @experimental
|
|
3872
|
+
*/
|
|
3831
3873
|
declare function createServerModuleRunner(environment: DevEnvironment, options?: ServerModuleRunnerOptions): ModuleRunner;
|
|
3832
3874
|
//#endregion
|
|
3833
3875
|
//#region src/node/server/environments/runnableEnvironment.d.ts
|
|
@@ -3865,9 +3907,9 @@ interface RunnerImportResult<T> {
|
|
|
3865
3907
|
dependencies: string[];
|
|
3866
3908
|
}
|
|
3867
3909
|
/**
|
|
3868
|
-
* Import any file using the default Vite environment.
|
|
3869
|
-
* @experimental
|
|
3870
|
-
*/
|
|
3910
|
+
* Import any file using the default Vite environment.
|
|
3911
|
+
* @experimental
|
|
3912
|
+
*/
|
|
3871
3913
|
declare function runnerImport<T>(moduleId: string, inlineConfig?: InlineConfig): Promise<RunnerImportResult<T>>;
|
|
3872
3914
|
//#endregion
|
|
3873
3915
|
//#region src/node/ssr/fetchModule.d.ts
|
|
@@ -3877,9 +3919,9 @@ interface FetchModuleOptions {
|
|
|
3877
3919
|
startOffset?: number;
|
|
3878
3920
|
}
|
|
3879
3921
|
/**
|
|
3880
|
-
* Fetch module information for Vite module runner.
|
|
3881
|
-
* @experimental
|
|
3882
|
-
*/
|
|
3922
|
+
* Fetch module information for Vite module runner.
|
|
3923
|
+
* @experimental
|
|
3924
|
+
*/
|
|
3883
3925
|
declare function fetchModule(environment: DevEnvironment, url: string, importer?: string, options?: FetchModuleOptions): Promise<moduleRunner_FetchResult>;
|
|
3884
3926
|
//#endregion
|
|
3885
3927
|
//#region src/node/ssr/ssrTransform.d.ts
|
|
@@ -3903,8 +3945,8 @@ declare const defaultAllowedOrigins: RegExp;
|
|
|
3903
3945
|
//#endregion
|
|
3904
3946
|
//#region src/node/utils.d.ts
|
|
3905
3947
|
/**
|
|
3906
|
-
* Inlined to keep `@rollup/pluginutils` in devDependencies
|
|
3907
|
-
*/
|
|
3948
|
+
* Inlined to keep `@rollup/pluginutils` in devDependencies
|
|
3949
|
+
*/
|
|
3908
3950
|
type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
|
|
3909
3951
|
declare const createFilter: (include?: FilterPattern, exclude?: FilterPattern, options?: {
|
|
3910
3952
|
resolve?: string | false | null;
|
|
@@ -3928,76 +3970,74 @@ declare function send(req: http.IncomingMessage, res: ServerResponse, content: s
|
|
|
3928
3970
|
//#endregion
|
|
3929
3971
|
//#region src/node/server/searchRoot.d.ts
|
|
3930
3972
|
/**
|
|
3931
|
-
* Search up for the nearest workspace root
|
|
3932
|
-
*/
|
|
3973
|
+
* Search up for the nearest workspace root
|
|
3974
|
+
*/
|
|
3933
3975
|
declare function searchForWorkspaceRoot(current: string, root?: string): string;
|
|
3934
3976
|
//#endregion
|
|
3935
3977
|
//#region src/node/server/middlewares/static.d.ts
|
|
3936
3978
|
/**
|
|
3937
|
-
* Check if the url is allowed to be served, via the `server.fs` config.
|
|
3938
|
-
* @deprecated Use the `isFileLoadingAllowed` function instead.
|
|
3939
|
-
*/
|
|
3979
|
+
* Check if the url is allowed to be served, via the `server.fs` config.
|
|
3980
|
+
* @deprecated Use the `isFileLoadingAllowed` function instead.
|
|
3981
|
+
*/
|
|
3940
3982
|
declare function isFileServingAllowed(config: ResolvedConfig, url: string): boolean;
|
|
3941
3983
|
declare function isFileServingAllowed(url: string, server: ViteDevServer): boolean;
|
|
3942
3984
|
/**
|
|
3943
|
-
* Warning: parameters are not validated, only works with normalized absolute paths
|
|
3944
|
-
*/
|
|
3985
|
+
* Warning: parameters are not validated, only works with normalized absolute paths
|
|
3986
|
+
*/
|
|
3945
3987
|
declare function isFileLoadingAllowed(config: ResolvedConfig, filePath: string): boolean;
|
|
3946
3988
|
//#endregion
|
|
3947
3989
|
//#region src/node/env.d.ts
|
|
3948
3990
|
/**
|
|
3949
|
-
* Load `.env` files within the `envDir` and merge them with the matching
|
|
3950
|
-
* variables already present in `process.env`.
|
|
3951
|
-
*/
|
|
3991
|
+
* Load `.env` files within the `envDir` and merge them with the matching
|
|
3992
|
+
* variables already present in `process.env`.
|
|
3993
|
+
*/
|
|
3952
3994
|
declare function loadEnv(mode: string, envDir: string | false, prefixes?: string | string[]): Record<string, string>;
|
|
3953
|
-
declare function resolveEnvPrefix({
|
|
3954
|
-
envPrefix
|
|
3955
|
-
}: UserConfig): string[];
|
|
3995
|
+
declare function resolveEnvPrefix({ envPrefix }: UserConfig): string[];
|
|
3956
3996
|
//#endregion
|
|
3957
3997
|
//#region src/node/plugins/manifest.d.ts
|
|
3958
3998
|
type Manifest = Record<string, ManifestChunk>;
|
|
3959
3999
|
interface ManifestChunk {
|
|
3960
4000
|
/**
|
|
3961
|
-
|
|
3962
|
-
|
|
4001
|
+
* The input file name of this chunk / asset if known
|
|
4002
|
+
*/
|
|
3963
4003
|
src?: string;
|
|
3964
4004
|
/**
|
|
3965
|
-
|
|
3966
|
-
|
|
4005
|
+
* The output file name of this chunk / asset
|
|
4006
|
+
*/
|
|
3967
4007
|
file: string;
|
|
3968
4008
|
/**
|
|
3969
|
-
|
|
3970
|
-
|
|
4009
|
+
* The list of CSS files imported by this chunk
|
|
4010
|
+
*/
|
|
3971
4011
|
css?: string[];
|
|
3972
4012
|
/**
|
|
3973
|
-
|
|
3974
|
-
|
|
4013
|
+
* The list of asset files imported by this chunk, excluding CSS files
|
|
4014
|
+
*/
|
|
3975
4015
|
assets?: string[];
|
|
3976
4016
|
/**
|
|
3977
|
-
|
|
3978
|
-
|
|
4017
|
+
* Whether this chunk or asset is an entry point
|
|
4018
|
+
*/
|
|
3979
4019
|
isEntry?: boolean;
|
|
3980
4020
|
/**
|
|
3981
|
-
|
|
3982
|
-
|
|
4021
|
+
* The name of this chunk / asset if known
|
|
4022
|
+
*/
|
|
3983
4023
|
name?: string;
|
|
3984
4024
|
/**
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
4025
|
+
* Whether this chunk is a dynamic entry point
|
|
4026
|
+
*
|
|
4027
|
+
* This field is only present in JS chunks.
|
|
4028
|
+
*/
|
|
3989
4029
|
isDynamicEntry?: boolean;
|
|
3990
4030
|
/**
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
4031
|
+
* The list of statically imported chunks by this chunk
|
|
4032
|
+
*
|
|
4033
|
+
* The values are the keys of the manifest. This field is only present in JS chunks.
|
|
4034
|
+
*/
|
|
3995
4035
|
imports?: string[];
|
|
3996
4036
|
/**
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4037
|
+
* The list of dynamically imported chunks by this chunk
|
|
4038
|
+
*
|
|
4039
|
+
* The values are the keys of the manifest. This field is only present in JS chunks.
|
|
4040
|
+
*/
|
|
4001
4041
|
dynamicImports?: string[];
|
|
4002
4042
|
}
|
|
4003
4043
|
//#endregion
|
|
@@ -4008,4 +4048,4 @@ declare const parseAst: typeof parseAst$1;
|
|
|
4008
4048
|
declare const parseAstAsync: typeof parseAstAsync$1;
|
|
4009
4049
|
declare const esbuildVersion = "0.25.0";
|
|
4010
4050
|
//#endregion
|
|
4011
|
-
export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type BindCLIShortcutsOptions, type BuildAppHook, BuildEnvironment, type BuildEnvironmentOptions, type BuildOptions, type BuilderOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type ChunkMetadata, type CommonServerOptions, type ConfigEnv, type ConfigPluginContext, type Connect, type ConnectedPayload, type CorsOptions, type CorsOrigin, type CustomEventMap, type CustomPayload, type CustomPluginOptionsVite, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, DevEnvironment, type DevEnvironmentContext, type DevEnvironmentOptions, type ESBuildOptions, type ESTree, type Environment, type EnvironmentModuleGraph, type EnvironmentModuleNode, type EnvironmentOptions, type ErrorPayload, type EsbuildTransformOptions, type ExperimentalOptions, type ExportsData, type FSWatcher, type FetchFunction, type FetchModuleOptions, type FetchResult, type FetchableDevEnvironment, type FetchableDevEnvironmentContext, type FileSystemServeOptions, type FilterPattern, type FullReloadPayload, type GeneralImportGlobOptions, type HMRPayload, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HotChannel, type HotChannelClient, type HotChannelListener, type HotPayload, type HotUpdateOptions, type HtmlAssetSource, type HtmlTagDescriptor, type index_d_exports as HttpProxy, type HttpServer, type ImportGlobFunction, type ImportGlobOptions, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InferCustomEventPayload, type InlineConfig, type InternalResolveOptions, type InvalidatePayload, type JsonOptions, type KnownAsTypeMap, type KnownQueryTypeMap, type LegacyOptions, type LessPreprocessorOptions, type LibraryFormats, type LibraryOptions, type LightningCSSOptions, type LogErrorOptions, type LogLevel, type LogOptions, type LogType, type Logger, type LoggerOptions, type Manifest, type ManifestChunk, type MapToFunction, type AnymatchMatcher as Matcher, type MinifyOptions, type MinifyResult, type MinimalPluginContextWithoutEnvironment, type ModuleGraph, type ModuleNode, type ModulePreloadOptions, type ModuleRunnerTransformOptions, type NormalizedHotChannel, type NormalizedHotChannelClient, type NormalizedServerHotChannel, type OptimizedDepInfo, type OxcOptions, type ParseResult, type ParserOptions, type Plugin, type PluginContainer, type PluginHookUtils, type PluginOption, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, type PrunePayload, type RenderBuiltAssetUrl, type ResolveFn, type ResolveModulePreloadDependenciesFn, type ResolveOptions, type ResolvedBuildEnvironmentOptions, type ResolvedBuildOptions, type ResolvedCSSOptions, type ResolvedConfig, type ResolvedDevEnvironmentOptions, type ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, type Rolldown, type Rollup, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type RunnableDevEnvironment, type RunnableDevEnvironmentContext, type SSROptions, type SSRTarget, type SassPreprocessorOptions, type SendOptions, type ServerHook, type ServerHotChannel, type ServerModuleRunnerOptions, type ServerOptions$1 as ServerOptions, type SkipInformation, type SsrDepOptimizationConfig, type StylusPreprocessorOptions, type Terser, type TerserOptions, type TransformOptions, type TransformResult, type Update, type UpdatePayload, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, Visitor, type VisitorObject, type ViteBuilder, type ViteDevServer, type WatchOptions, type WebSocket, type WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, type WebSocketServer, type WsOptions, build, buildErrorMessage, createBuilder, createFetchableDevEnvironment, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defaultAllowedOrigins, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_EXTERNAL_CONDITIONS as defaultExternalConditions, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, defineConfig, esbuildVersion, esmExternalRequirePlugin, fetchModule, formatPostcssSourceMap, isCSSRequest, isFetchableDevEnvironment, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, minify, minifySync, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, parse, parseAst, parseAstAsync, parseSync, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rolldownVersion, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, transformWithEsbuild, transformWithOxc, VERSION as version, withFilter };
|
|
4051
|
+
export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type BindCLIShortcutsOptions, type BuildAppHook, BuildEnvironment, type BuildEnvironmentOptions, type BuildOptions, type BuilderOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type ChunkMetadata, type CommonServerOptions, type ConfigEnv, type ConfigPluginContext, type Connect, type ConnectedPayload, type CorsOptions, type CorsOrigin, type CustomEventMap, type CustomPayload, type CustomPluginOptionsVite, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, DevEnvironment, type DevEnvironmentContext, type DevEnvironmentOptions, type ESBuildOptions, type ESTree, type Environment, type EnvironmentModuleGraph, type EnvironmentModuleNode, type EnvironmentOptions, type ErrorPayload, type EsbuildTransformOptions, type ExperimentalOptions, type ExportsData, type FSWatcher, type FetchFunction, type FetchModuleOptions, type FetchResult, type FetchableDevEnvironment, type FetchableDevEnvironmentContext, type FileSystemServeOptions, type FilterPattern, type FullReloadPayload, type GeneralImportGlobOptions, type HMRPayload, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HotChannel, type HotChannelClient, type HotChannelListener, type HotPayload, type HotUpdateOptions, type HtmlAssetSource, type HtmlTagDescriptor, type index_d_exports as HttpProxy, type HttpServer, type ImportGlobFunction, type ImportGlobOptions, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InferCustomEventPayload, type InlineConfig, type InternalResolveOptions, type InvalidatePayload, type JsonOptions, type KnownAsTypeMap, type KnownQueryTypeMap, type LegacyOptions, type LessPreprocessorOptions, type LibraryFormats, type LibraryOptions, type LightningCSSOptions, type LogErrorOptions, type LogLevel, type LogOptions, type LogType, type Logger, type LoggerOptions, type Manifest, type ManifestChunk, type MapToFunction, type AnymatchMatcher as Matcher, type MinifyOptions, type MinifyResult, type MinimalPluginContextWithoutEnvironment, type ModuleGraph, type ModuleNode, type ModulePreloadOptions, type ModuleRunnerTransformOptions, type NormalizedHotChannel, type NormalizedHotChannelClient, type NormalizedServerHotChannel, type OptimizedDepInfo, type OxcOptions, type ParseResult, type ParserOptions, type Plugin, type PluginContainer, type PluginHookUtils, type PluginOption, type Config as PostcssUserConfig, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, type PrunePayload, type RenderBuiltAssetUrl, type ResolveFn, type ResolveModulePreloadDependenciesFn, type ResolveOptions, type ResolvedBuildEnvironmentOptions, type ResolvedBuildOptions, type ResolvedCSSOptions, type ResolvedConfig, type ResolvedDevEnvironmentOptions, type ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, type Rolldown, type Rollup, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type RunnableDevEnvironment, type RunnableDevEnvironmentContext, type SSROptions, type SSRTarget, type SassPreprocessorOptions, type SendOptions, type ServerHook, type ServerHotChannel, type ServerModuleRunnerOptions, type ServerOptions$1 as ServerOptions, type SkipInformation, type SsrDepOptimizationConfig, type StylusPreprocessorOptions, type Terser, type TerserOptions, type TransformOptions, type TransformResult, type Update, type UpdatePayload, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, Visitor, type VisitorObject, type ViteBuilder, type ViteDevServer, type WatchOptions, type WebSocket, type WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, type WebSocketServer, type WsOptions, build, buildErrorMessage, createBuilder, createFetchableDevEnvironment, createFilter, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, createServerModuleRunnerTransport, defaultAllowedOrigins, DEFAULT_CLIENT_CONDITIONS as defaultClientConditions, DEFAULT_CLIENT_MAIN_FIELDS as defaultClientMainFields, DEFAULT_EXTERNAL_CONDITIONS as defaultExternalConditions, DEFAULT_SERVER_CONDITIONS as defaultServerConditions, DEFAULT_SERVER_MAIN_FIELDS as defaultServerMainFields, defineConfig, esbuildVersion, esmExternalRequirePlugin, fetchModule, formatPostcssSourceMap, isCSSRequest, isFetchableDevEnvironment, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, minify, minifySync, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, parse, parseAst, parseAstAsync, parseSync, perEnvironmentPlugin, perEnvironmentState, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rolldownVersion, rollupVersion, runnerImport, searchForWorkspaceRoot, send, sortUserPlugins, transformWithEsbuild, transformWithOxc, VERSION as version, withFilter };
|