From 68e94353f0b3d2e877d49c73a9650a1989d944f3 Mon Sep 17 00:00:00 2001 From: Nicholas Cunningham Date: Thu, 24 Feb 2022 07:37:41 -0700 Subject: [PATCH] fix(web): fixes force down compilation for non esm bundles (#8907) When you use swc as the compiler for a library the types should be generated ISSUES CLOSED: #8639 --- .../web/src/executors/rollup/rollup.impl.ts | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/packages/web/src/executors/rollup/rollup.impl.ts b/packages/web/src/executors/rollup/rollup.impl.ts index 73749eb02096f..c98492157e541 100644 --- a/packages/web/src/executors/rollup/rollup.impl.ts +++ b/packages/web/src/executors/rollup/rollup.impl.ts @@ -207,11 +207,7 @@ export function createRollupOptions( check: true, tsconfig: options.tsConfig, tsconfigOverride: { - compilerOptions: createCompilerOptions( - format, - options, - dependencies - ), + compilerOptions: createCompilerOptions(options, dependencies), }, }), useSwc && swc(), @@ -297,27 +293,18 @@ export function createRollupOptions( }); } -function createCompilerOptions(format, options, dependencies) { +function createCompilerOptions(options, dependencies) { const compilerOptionPaths = computeCompilerOptionsPaths( options.tsConfig, dependencies ); - const compilerOptions = { + return { rootDir: options.entryRoot, allowJs: false, declaration: true, paths: compilerOptionPaths, }; - - if (format !== 'esm') { - return { - ...compilerOptions, - target: 'es5', - }; - } - - return compilerOptions; } function updatePackageJson(