目标环境
在CLI
指令解析时,格式化target
相关配置
if (flags.target) {
options.target = flags.target.indexOf(',') >= 0 ? flags.target.split(',') : flags.target;
}
在构建格式化时,如果没有设置target
时,默认读取tsconfig
中的compilerOptions.target
。
if (!options.target) {
options.target = tsconfig.data?.compilerOptions?.target?.toLowerCase();
}
在runEsbuild
方法中,传给esbuild
的target
属性。
esbuild({
target: options.target,,
})