Skip to content

Commit

Permalink
feat(vite): allow setting of build target
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarini committed Apr 26, 2023
1 parent 308dea3 commit d31a09e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/generated/packages/vite/executors/build.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
"description": "Output sourcemaps. Use 'hidden' for use with error reporting tools without generating sourcemap comment.",
"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": {
"description": "Output sourcemaps. Use 'hidden' for use with error reporting tools without generating sourcemap comment.",
"oneOf": [{ "type": "boolean" }, { "type": "string" }]
Expand Down
1 change: 1 addition & 0 deletions packages/vite/src/executors/build/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ export interface ViteBuildExecutorOptions {
mode?: string;
ssr?: boolean | string;
watch?: object | boolean;
target?: string | string[];
}
4 changes: 4 additions & 0 deletions packages/vite/src/executors/build/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
"description": "Output sourcemaps. Use 'hidden' for use with error reporting tools without generating sourcemap comment.",
"oneOf": [
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/utils/options-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export function getViteBuildOptions(
emptyOutDir: options.emptyOutDir,
reportCompressedSize: true,
cssCodeSplit: true,
target: 'esnext',
target: options.target ?? 'esnext',
commonjsOptions: {
transformMixedEsModules: true,
},
Expand Down

0 comments on commit d31a09e

Please sign in to comment.