Skip to content

Commit

Permalink
fix(web): fixes force down compilation for non esm bundles (#8907)
Browse files Browse the repository at this point in the history
When you use swc as the compiler for a library the types should be generated

ISSUES CLOSED: #8639
  • Loading branch information
ndcunningham committed Feb 24, 2022
1 parent 61ed903 commit 68e9435
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions packages/web/src/executors/rollup/rollup.impl.ts
Expand Up @@ -207,11 +207,7 @@ export function createRollupOptions(
check: true,
tsconfig: options.tsConfig,
tsconfigOverride: {
compilerOptions: createCompilerOptions(
format,
options,
dependencies
),
compilerOptions: createCompilerOptions(options, dependencies),
},
}),
useSwc && swc(),
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 68e9435

Please sign in to comment.