feat(vite): allow setting of build target (#16588)
This commit is contained in:
parent
cab7aacc55
commit
44654251bd
@ -58,6 +58,10 @@
|
|||||||
"description": "Output sourcemaps. Use 'hidden' for use with error reporting tools without generating sourcemap comment.",
|
"description": "Output sourcemaps. Use 'hidden' for use with error reporting tools without generating sourcemap comment.",
|
||||||
"oneOf": [{ "type": "boolean" }, { "type": "string" }]
|
"oneOf": [{ "type": "boolean" }, { "type": "string" }]
|
||||||
},
|
},
|
||||||
|
"target": {
|
||||||
|
"description": "Browser compatibility target for the final bundle. For more info: https://vitejs.dev/config/build-options.html#build-target",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"minify": {
|
"minify": {
|
||||||
"description": "Output sourcemaps. Use 'hidden' for use with error reporting tools without generating sourcemap comment.",
|
"description": "Output sourcemaps. Use 'hidden' for use with error reporting tools without generating sourcemap comment.",
|
||||||
"oneOf": [{ "type": "boolean" }, { "type": "string" }]
|
"oneOf": [{ "type": "boolean" }, { "type": "string" }]
|
||||||
|
|||||||
@ -14,4 +14,5 @@ export interface ViteBuildExecutorOptions {
|
|||||||
mode?: string;
|
mode?: string;
|
||||||
ssr?: boolean | string;
|
ssr?: boolean | string;
|
||||||
watch?: object | boolean;
|
watch?: object | boolean;
|
||||||
|
target?: string | string[];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,6 +67,10 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"target": {
|
||||||
|
"description": "Browser compatibility target for the final bundle. For more info: https://vitejs.dev/config/build-options.html#build-target",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"minify": {
|
"minify": {
|
||||||
"description": "Output sourcemaps. Use 'hidden' for use with error reporting tools without generating sourcemap comment.",
|
"description": "Output sourcemaps. Use 'hidden' for use with error reporting tools without generating sourcemap comment.",
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
|
|||||||
@ -139,7 +139,7 @@ export function getViteBuildOptions(
|
|||||||
emptyOutDir: options.emptyOutDir,
|
emptyOutDir: options.emptyOutDir,
|
||||||
reportCompressedSize: true,
|
reportCompressedSize: true,
|
||||||
cssCodeSplit: true,
|
cssCodeSplit: true,
|
||||||
target: 'esnext',
|
target: options.target ?? 'esnext',
|
||||||
commonjsOptions: {
|
commonjsOptions: {
|
||||||
transformMixedEsModules: true,
|
transformMixedEsModules: true,
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user