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