From c973384c6b6c697bac978a5e8bd722d087684820 Mon Sep 17 00:00:00 2001 From: bluwy Date: Fri, 23 Sep 2022 13:18:47 +0800 Subject: [PATCH 1/2] fix(esbuild): transpile with esnext --- packages/plugin-vue/src/main.ts | 6 +- packages/vite/package.json | 2 +- packages/vite/src/node/plugins/esbuild.ts | 1 + playground/vue/tsconfig.json | 7 + pnpm-lock.yaml | 168 +++++++++++----------- 5 files changed, 96 insertions(+), 88 deletions(-) create mode 100644 playground/vue/tsconfig.json diff --git a/packages/plugin-vue/src/main.ts b/packages/plugin-vue/src/main.ts index bdb846ab4abcfd..5d76256f75c2c2 100644 --- a/packages/plugin-vue/src/main.ts +++ b/packages/plugin-vue/src/main.ts @@ -221,7 +221,11 @@ export async function transformMain( const { code, map } = await transformWithEsbuild( resolvedCode, filename, - { loader: 'ts', sourcemap: options.sourceMap }, + { + loader: 'ts', + target: 'esnext', + sourcemap: options.sourceMap + }, resolvedMap ) resolvedCode = code diff --git a/packages/vite/package.json b/packages/vite/package.json index e0771bbc395a41..50c28b1801e11c 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -58,7 +58,7 @@ }, "//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!", "dependencies": { - "esbuild": "^0.15.6", + "esbuild": "^0.15.9", "postcss": "^8.4.16", "resolve": "^1.22.1", "rollup": "~2.78.0" diff --git a/packages/vite/src/node/plugins/esbuild.ts b/packages/vite/src/node/plugins/esbuild.ts index f1fbe8e607342e..66dcc019cd2553 100644 --- a/packages/vite/src/node/plugins/esbuild.ts +++ b/packages/vite/src/node/plugins/esbuild.ts @@ -180,6 +180,7 @@ export function esbuildPlugin(options: ESBuildOptions = {}): Plugin { // and for build as the final optimization is in `buildEsbuildPlugin` const transformOptions: TransformOptions = { ...options, + target: 'esnext', minify: false, minifyIdentifiers: false, minifySyntax: false, diff --git a/playground/vue/tsconfig.json b/playground/vue/tsconfig.json new file mode 100644 index 00000000000000..5f90cb166d696b --- /dev/null +++ b/playground/vue/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + // esbuild transpile should ignore this + "target": "ES5" + }, + "include": ["src"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d3dd6f4ac84fde..fe6cc0aed79645 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -236,7 +236,7 @@ importers: dotenv: ^14.3.2 dotenv-expand: ^5.1.0 es-module-lexer: ^1.0.3 - esbuild: ^0.15.6 + esbuild: ^0.15.9 estree-walker: ^3.0.1 etag: ^1.8.1 fast-glob: ^3.2.12 @@ -272,7 +272,7 @@ importers: ufo: ^0.8.5 ws: ^8.8.1 dependencies: - esbuild: 0.15.6 + esbuild: 0.15.9 postcss: 8.4.16 resolve: 1.22.1 rollup: 2.78.0 @@ -1956,8 +1956,16 @@ packages: get-tsconfig: 4.1.0 dev: true - /@esbuild/linux-loong64/0.15.6: - resolution: {integrity: sha512-hqmVU2mUjH6J2ZivHphJ/Pdse2ZD+uGCHK0uvsiLDk/JnSedEVj77CiVUnbMKuU4tih1TZZL8tG9DExQg/GZsw==} + /@esbuild/android-arm/0.15.9: + resolution: {integrity: sha512-VZPy/ETF3fBG5PiinIkA0W/tlsvlEgJccyN2DzWZEl0DlVKRbu91PvY2D6Lxgluj4w9QtYHjOWjAT44C+oQ+EQ==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + optional: true + + /@esbuild/linux-loong64/0.15.9: + resolution: {integrity: sha512-O+NfmkfRrb3uSsTa4jE3WApidSe3N5++fyOVGP1SmMZi4A3BZELkhUUvj5hwmMuNdlpzAZ8iAPz2vmcR7DCFQA==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -4172,8 +4180,8 @@ packages: dev: true optional: true - /esbuild-android-64/0.15.6: - resolution: {integrity: sha512-Z1CHSgB1crVQi2LKSBwSkpaGtaloVz0ZIYcRMsvHc3uSXcR/x5/bv9wcZspvH/25lIGTaViosciS/NS09ERmVA==} + /esbuild-android-64/0.15.9: + resolution: {integrity: sha512-HQCX7FJn9T4kxZQkhPjNZC7tBWZqJvhlLHPU2SFzrQB/7nDXjmTIFpFTjt7Bd1uFpeXmuwf5h5fZm+x/hLnhbw==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -4198,8 +4206,8 @@ packages: dev: true optional: true - /esbuild-android-arm64/0.15.6: - resolution: {integrity: sha512-mvM+gqNxqKm2pCa3dnjdRzl7gIowuc4ga7P7c3yHzs58Im8v/Lfk1ixSgQ2USgIywT48QWaACRa3F4MG7djpSw==} + /esbuild-android-arm64/0.15.9: + resolution: {integrity: sha512-E6zbLfqbFVCNEKircSHnPiSTsm3fCRxeIMPfrkS33tFjIAoXtwegQfVZqMGR0FlsvVxp2NEDOUz+WW48COCjSg==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -4224,8 +4232,8 @@ packages: dev: true optional: true - /esbuild-darwin-64/0.15.6: - resolution: {integrity: sha512-BsfVt3usScAfGlXJiGtGamwVEOTM8AiYiw1zqDWhGv6BncLXCnTg1As+90mxWewdTZKq3iIy8s9g8CKkrrAXVw==} + /esbuild-darwin-64/0.15.9: + resolution: {integrity: sha512-gI7dClcDN/HHVacZhTmGjl0/TWZcGuKJ0I7/xDGJwRQQn7aafZGtvagOFNmuOq+OBFPhlPv1T6JElOXb0unkSQ==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -4250,8 +4258,8 @@ packages: dev: true optional: true - /esbuild-darwin-arm64/0.15.6: - resolution: {integrity: sha512-CnrAeJaEpPakUobhqO4wVSA4Zm6TPaI5UY4EsI62j9mTrjIyQPXA1n4Ju6Iu5TVZRnEqV6q8blodgYJ6CJuwCA==} + /esbuild-darwin-arm64/0.15.9: + resolution: {integrity: sha512-VZIMlcRN29yg/sv7DsDwN+OeufCcoTNaTl3Vnav7dL/nvsApD7uvhVRbgyMzv0zU/PP0xRhhIpTyc7lxEzHGSw==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -4276,8 +4284,8 @@ packages: dev: true optional: true - /esbuild-freebsd-64/0.15.6: - resolution: {integrity: sha512-+qFdmqi+jkAsxsNJkaWVrnxEUUI50nu6c3MBVarv3RCDCbz7ZS1a4ZrdkwEYFnKcVWu6UUE0Kkb1SQ1yGEG6sg==} + /esbuild-freebsd-64/0.15.9: + resolution: {integrity: sha512-uM4z5bTvuAXqPxrI204txhlsPIolQPWRMLenvGuCPZTnnGlCMF2QLs0Plcm26gcskhxewYo9LkkmYSS5Czrb5A==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -4302,8 +4310,8 @@ packages: dev: true optional: true - /esbuild-freebsd-arm64/0.15.6: - resolution: {integrity: sha512-KtQkQOhnNciXm2yrTYZMD3MOm2zBiiwFSU+dkwNbcfDumzzUprr1x70ClTdGuZwieBS1BM/k0KajRQX7r504Xw==} + /esbuild-freebsd-arm64/0.15.9: + resolution: {integrity: sha512-HHDjT3O5gWzicGdgJ5yokZVN9K9KG05SnERwl9nBYZaCjcCgj/sX8Ps1jvoFSfNCO04JSsHSOWo4qvxFuj8FoA==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -4328,8 +4336,8 @@ packages: dev: true optional: true - /esbuild-linux-32/0.15.6: - resolution: {integrity: sha512-IAkDNz3TpxwISTGVdQijwyHBZrbFgLlRi5YXcvaEHtgbmayLSDcJmH5nV1MFgo/x2QdKcHBkOYHdjhKxUAcPwg==} + /esbuild-linux-32/0.15.9: + resolution: {integrity: sha512-AQIdE8FugGt1DkcekKi5ycI46QZpGJ/wqcMr7w6YUmOmp2ohQ8eO4sKUsOxNOvYL7hGEVwkndSyszR6HpVHLFg==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -4354,8 +4362,8 @@ packages: dev: true optional: true - /esbuild-linux-64/0.15.6: - resolution: {integrity: sha512-gQPksyrEYfA4LJwyfTQWAZaVZCx4wpaLrSzo2+Xc9QLC+i/sMWmX31jBjrn4nLJCd79KvwCinto36QC7BEIU/A==} + /esbuild-linux-64/0.15.9: + resolution: {integrity: sha512-4RXjae7g6Qs7StZyiYyXTZXBlfODhb1aBVAjd+ANuPmMhWthQilWo7rFHwJwL7DQu1Fjej2sODAVwLbcIVsAYQ==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -4380,8 +4388,8 @@ packages: dev: true optional: true - /esbuild-linux-arm/0.15.6: - resolution: {integrity: sha512-xZ0Bq2aivsthDjA/ytQZzxrxIZbG0ATJYMJxNeOIBc1zUjpbVpzBKgllOZMsTSXMHFHGrow6TnCcgwqY0+oEoQ==} + /esbuild-linux-arm/0.15.9: + resolution: {integrity: sha512-3Zf2GVGUOI7XwChH3qrnTOSqfV1V4CAc/7zLVm4lO6JT6wbJrTgEYCCiNSzziSju+J9Jhf9YGWk/26quWPC6yQ==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -4406,8 +4414,8 @@ packages: dev: true optional: true - /esbuild-linux-arm64/0.15.6: - resolution: {integrity: sha512-aovDkclFa6C9EdZVBuOXxqZx83fuoq8097xZKhEPSygwuy4Lxs8J4anHG7kojAsR+31lfUuxzOo2tHxv7EiNHA==} + /esbuild-linux-arm64/0.15.9: + resolution: {integrity: sha512-a+bTtxJmYmk9d+s2W4/R1SYKDDAldOKmWjWP0BnrWtDbvUBNOm++du0ysPju4mZVoEFgS1yLNW+VXnG/4FNwdQ==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -4432,8 +4440,8 @@ packages: dev: true optional: true - /esbuild-linux-mips64le/0.15.6: - resolution: {integrity: sha512-wVpW8wkWOGizsCqCwOR/G3SHwhaecpGy3fic9BF1r7vq4djLjUcA8KunDaBCjJ6TgLQFhJ98RjDuyEf8AGjAvw==} + /esbuild-linux-mips64le/0.15.9: + resolution: {integrity: sha512-Zn9HSylDp89y+TRREMDoGrc3Z4Hs5u56ozZLQCiZAUx2+HdbbXbWdjmw3FdTJ/i7t5Cew6/Q+6kfO3KCcFGlyw==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -4458,8 +4466,8 @@ packages: dev: true optional: true - /esbuild-linux-ppc64le/0.15.6: - resolution: {integrity: sha512-z6w6gsPH/Y77uchocluDC8tkCg9rfkcPTePzZKNr879bF4tu7j9t255wuNOCE396IYEGxY7y8u2HJ9i7kjCLVw==} + /esbuild-linux-ppc64le/0.15.9: + resolution: {integrity: sha512-OEiOxNAMH9ENFYqRsWUj3CWyN3V8P3ZXyfNAtX5rlCEC/ERXrCEFCJji/1F6POzsXAzxvUJrTSTCy7G6BhA6Fw==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -4484,8 +4492,8 @@ packages: dev: true optional: true - /esbuild-linux-riscv64/0.15.6: - resolution: {integrity: sha512-pfK/3MJcmbfU399TnXW5RTPS1S+ID6ra+CVj9TFZ2s0q9Ja1F5A1VirUUvViPkjiw+Kq3zveyn6U09Wg1zJXrw==} + /esbuild-linux-riscv64/0.15.9: + resolution: {integrity: sha512-ukm4KsC3QRausEFjzTsOZ/qqazw0YvJsKmfoZZm9QW27OHjk2XKSQGGvx8gIEswft/Sadp03/VZvAaqv5AIwNA==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -4510,8 +4518,8 @@ packages: dev: true optional: true - /esbuild-linux-s390x/0.15.6: - resolution: {integrity: sha512-OZeeDu32liefcwAE63FhVqM4heWTC8E3MglOC7SK0KYocDdY/6jyApw0UDkDHlcEK9mW6alX/SH9r3PDjcCo/Q==} + /esbuild-linux-s390x/0.15.9: + resolution: {integrity: sha512-uDOQEH55wQ6ahcIKzQr3VyjGc6Po/xblLGLoUk3fVL1qjlZAibtQr6XRfy5wPJLu/M2o0vQKLq4lyJ2r1tWKcw==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -4536,8 +4544,8 @@ packages: dev: true optional: true - /esbuild-netbsd-64/0.15.6: - resolution: {integrity: sha512-kaxw61wcHMyiEsSsi5ut1YYs/hvTC2QkxJwyRvC2Cnsz3lfMLEu8zAjpBKWh9aU/N0O/gsRap4wTur5GRuSvBA==} + /esbuild-netbsd-64/0.15.9: + resolution: {integrity: sha512-yWgxaYTQz+TqX80wXRq6xAtb7GSBAp6gqLKfOdANg9qEmAI1Bxn04IrQr0Mzm4AhxvGKoHzjHjMgXbCCSSDxcw==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -4562,8 +4570,8 @@ packages: dev: true optional: true - /esbuild-openbsd-64/0.15.6: - resolution: {integrity: sha512-CuoY60alzYfIZapUHqFXqXbj88bbRJu8Fp9okCSHRX2zWIcGz4BXAHXiG7dlCye5nFVrY72psesLuWdusyf2qw==} + /esbuild-openbsd-64/0.15.9: + resolution: {integrity: sha512-JmS18acQl4iSAjrEha1MfEmUMN4FcnnrtTaJ7Qg0tDCOcgpPPQRLGsZqhes0vmx8VA6IqRyScqXvaL7+Q0Uf3A==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -4588,8 +4596,8 @@ packages: dev: true optional: true - /esbuild-sunos-64/0.15.6: - resolution: {integrity: sha512-1ceefLdPWcd1nW/ZLruPEYxeUEAVX0YHbG7w+BB4aYgfknaLGotI/ZvPWUZpzhC8l1EybrVlz++lm3E6ODIJOg==} + /esbuild-sunos-64/0.15.9: + resolution: {integrity: sha512-UKynGSWpzkPmXW3D2UMOD9BZPIuRaSqphxSCwScfEE05Be3KAmvjsBhht1fLzKpiFVJb0BYMd4jEbWMyJ/z1hQ==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -4614,8 +4622,8 @@ packages: dev: true optional: true - /esbuild-windows-32/0.15.6: - resolution: {integrity: sha512-pBqdOsKqCD5LRYiwF29PJRDJZi7/Wgkz46u3d17MRFmrLFcAZDke3nbdDa1c8YgY78RiemudfCeAemN8EBlIpA==} + /esbuild-windows-32/0.15.9: + resolution: {integrity: sha512-aqXvu4/W9XyTVqO/hw3rNxKE1TcZiEYHPsXM9LwYmKSX9/hjvfIJzXwQBlPcJ/QOxedfoMVH0YnhhQ9Ffb0RGA==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -4640,8 +4648,8 @@ packages: dev: true optional: true - /esbuild-windows-64/0.15.6: - resolution: {integrity: sha512-KpPOh4aTOo//g9Pk2oVAzXMpc9Sz9n5A9sZTmWqDSXCiiachfFhbuFlsKBGATYCVitXfmBIJ4nNYYWSOdz4hQg==} + /esbuild-windows-64/0.15.9: + resolution: {integrity: sha512-zm7h91WUmlS4idMtjvCrEeNhlH7+TNOmqw5dJPJZrgFaxoFyqYG6CKDpdFCQXdyKpD5yvzaQBOMVTCBVKGZDEg==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -4666,8 +4674,8 @@ packages: dev: true optional: true - /esbuild-windows-arm64/0.15.6: - resolution: {integrity: sha512-DB3G2x9OvFEa00jV+OkDBYpufq5x/K7a6VW6E2iM896DG4ZnAvJKQksOsCPiM1DUaa+DrijXAQ/ZOcKAqf/3Hg==} + /esbuild-windows-arm64/0.15.9: + resolution: {integrity: sha512-yQEVIv27oauAtvtuhJVfSNMztJJX47ismRS6Sv2QMVV9RM+6xjbMWuuwM2nxr5A2/gj/mu2z9YlQxiwoFRCfZA==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -4730,33 +4738,34 @@ packages: esbuild-windows-arm64: 0.14.50 dev: true - /esbuild/0.15.6: - resolution: {integrity: sha512-sgLOv3l4xklvXzzczhRwKRotyrfyZ2i1fCS6PTOLPd9wevDPArGU8HFtHrHCOcsMwTjLjzGm15gvC8uxVzQf+w==} + /esbuild/0.15.9: + resolution: {integrity: sha512-OnYr1rkMVxtmMHIAKZLMcEUlJmqcbxBz9QoBU8G9v455na0fuzlT/GLu6l+SRghrk0Mm2fSSciMmzV43Q8e0Gg==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/linux-loong64': 0.15.6 - esbuild-android-64: 0.15.6 - esbuild-android-arm64: 0.15.6 - esbuild-darwin-64: 0.15.6 - esbuild-darwin-arm64: 0.15.6 - esbuild-freebsd-64: 0.15.6 - esbuild-freebsd-arm64: 0.15.6 - esbuild-linux-32: 0.15.6 - esbuild-linux-64: 0.15.6 - esbuild-linux-arm: 0.15.6 - esbuild-linux-arm64: 0.15.6 - esbuild-linux-mips64le: 0.15.6 - esbuild-linux-ppc64le: 0.15.6 - esbuild-linux-riscv64: 0.15.6 - esbuild-linux-s390x: 0.15.6 - esbuild-netbsd-64: 0.15.6 - esbuild-openbsd-64: 0.15.6 - esbuild-sunos-64: 0.15.6 - esbuild-windows-32: 0.15.6 - esbuild-windows-64: 0.15.6 - esbuild-windows-arm64: 0.15.6 + '@esbuild/android-arm': 0.15.9 + '@esbuild/linux-loong64': 0.15.9 + esbuild-android-64: 0.15.9 + esbuild-android-arm64: 0.15.9 + esbuild-darwin-64: 0.15.9 + esbuild-darwin-arm64: 0.15.9 + esbuild-freebsd-64: 0.15.9 + esbuild-freebsd-arm64: 0.15.9 + esbuild-linux-32: 0.15.9 + esbuild-linux-64: 0.15.9 + esbuild-linux-arm: 0.15.9 + esbuild-linux-arm64: 0.15.9 + esbuild-linux-mips64le: 0.15.9 + esbuild-linux-ppc64le: 0.15.9 + esbuild-linux-riscv64: 0.15.9 + esbuild-linux-s390x: 0.15.9 + esbuild-netbsd-64: 0.15.9 + esbuild-openbsd-64: 0.15.9 + esbuild-sunos-64: 0.15.9 + esbuild-windows-32: 0.15.9 + esbuild-windows-64: 0.15.9 + esbuild-windows-arm64: 0.15.9 /escalade/3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} @@ -5214,19 +5223,6 @@ packages: peerDependenciesMeta: debug: optional: true - dev: false - - /follow-redirects/1.15.0_debug@4.3.4: - resolution: {integrity: sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dependencies: - debug: 4.3.4 - dev: true /form-data/4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} @@ -5620,7 +5616,7 @@ packages: engines: {node: '>=8.0.0'} dependencies: eventemitter3: 4.0.7 - follow-redirects: 1.15.0_debug@4.3.4 + follow-redirects: 1.15.0 requires-port: 1.0.0 transitivePeerDependencies: - debug @@ -7700,7 +7696,7 @@ packages: '@babel/code-frame': 7.18.6 dev: true - /rollup-plugin-esbuild/4.10.1_ajqsvouysgwbbwdvvze7lmgc4q: + /rollup-plugin-esbuild/4.10.1_zprrkcbct7bo6atdakidof6o3q: resolution: {integrity: sha512-/ymcRB283zjFp1JTBXO8ekxv0c9vRc2L6OTljghsLthQ4vqeDSDWa9BVz1tHiVrx6SbUnUpDPLC0K/MXK7j5TA==} engines: {node: '>=12'} peerDependencies: @@ -7710,7 +7706,7 @@ packages: '@rollup/pluginutils': 4.2.1 debug: 4.3.4 es-module-lexer: 0.9.3 - esbuild: 0.15.6 + esbuild: 0.15.9 joycon: 3.1.1 jsonc-parser: 3.1.0 rollup: 2.79.0 @@ -8625,7 +8621,7 @@ packages: chalk: 5.0.1 consola: 2.15.3 defu: 6.1.0 - esbuild: 0.15.6 + esbuild: 0.15.9 globby: 13.1.2 hookable: 5.3.0 jiti: 1.14.0 @@ -8640,7 +8636,7 @@ packages: rimraf: 3.0.2 rollup: 2.79.0 rollup-plugin-dts: 4.2.2_id3sp2lbl4kx3dskm7teaj32um - rollup-plugin-esbuild: 4.10.1_ajqsvouysgwbbwdvvze7lmgc4q + rollup-plugin-esbuild: 4.10.1_zprrkcbct7bo6atdakidof6o3q scule: 0.3.2 typescript: 4.8.2 untyped: 0.4.7 @@ -9366,7 +9362,7 @@ packages: file:playground/ssr-resolve/pkg-exports: resolution: {directory: playground/ssr-resolve/pkg-exports, type: directory} - name: pkg-exports-cjs + name: pkg-exports version: 0.0.0 dev: false From 2492e23ab816a1c51dd8d2a4ab772168b68689cd Mon Sep 17 00:00:00 2001 From: bluwy Date: Fri, 23 Sep 2022 13:49:25 +0800 Subject: [PATCH 2/2] fix: allow override esbuild target --- packages/vite/src/node/plugins/esbuild.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/node/plugins/esbuild.ts b/packages/vite/src/node/plugins/esbuild.ts index 66dcc019cd2553..43c319f2713761 100644 --- a/packages/vite/src/node/plugins/esbuild.ts +++ b/packages/vite/src/node/plugins/esbuild.ts @@ -179,8 +179,8 @@ export function esbuildPlugin(options: ESBuildOptions = {}): Plugin { // Remove optimization options for dev as we only need to transpile them, // and for build as the final optimization is in `buildEsbuildPlugin` const transformOptions: TransformOptions = { - ...options, target: 'esnext', + ...options, minify: false, minifyIdentifiers: false, minifySyntax: false,