boolean | import('cors').CorsOptionsfalse>= 1.1.11Configure CORS options for the dev server or preview server, based on the cors middleware.
true:Enable CORS with default options.false:Disable CORS.object:Enable CORS with the specified options.Although cors can be set to true, we recommend setting a specified origin option to prevent untrusted origins from accessing your dev server.
Only enable CORS for the dev server:
Disable CORS:
The cors option can be an object, which is the same as the cors middleware options.
The default configuration is the equivalent of:
For example, use the origin option to configure the Access-Control-Allow-Origin header: