Skip to content

Commit

Permalink
fix(web): fixes force down compilation for non esm bundles
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: nrwl#8639
  • Loading branch information
ndcunningham committed Feb 9, 2022
1 parent da64519 commit dbc6d27
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 @@ -204,11 +204,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 @@ -294,27 +290,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 dbc6d27

Please sign in to comment.