From 309e5e32bd847751439ae1467842af55bf4e8a6f Mon Sep 17 00:00:00 2001 From: Mark de Bruijn Date: Fri, 15 May 2020 12:41:26 +0200 Subject: [PATCH] Force esbuild to output ES2019 Rollup does not appear to support optional chaining (`foo?.bar`). Work around this by lowering the esbuild target to ES2019 Related: https://github.com/rollup/plugins/issues/205 --- src/node/esbuildService.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node/esbuildService.ts b/src/node/esbuildService.ts index f62f8ba029b4c8..6c4995107551b9 100644 --- a/src/node/esbuildService.ts +++ b/src/node/esbuildService.ts @@ -62,7 +62,8 @@ export const transform = async ( ...options, loader: options.loader || (path.extname(file).slice(1) as any), sourcemap: true, - sourcefile: file + sourcefile: file, + target: 'es2019' } try { const result = await service.transform(src, options)