Skip to content

Commit

Permalink
feat(nextjs): can set compiler when setting up `nxComponentTestingPre…
Browse files Browse the repository at this point in the history
…set`

Currently nextjs only uses the *swa* compiler

To use @cypress/code-coverage you need to use *babel*, you can now select which compiler to use.

closed nrwl#19131
  • Loading branch information
erenken committed Sep 14, 2023
1 parent f639883 commit c1a0442
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/cypress/plugins/cypress-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface NxComponentTestingOptions {
*/
ctTargetName?: string;
bundler?: 'vite' | 'webpack';
compiler?: 'swc' | 'babel';
}

export function nxBaseCypressPreset(
Expand Down
2 changes: 1 addition & 1 deletion packages/next/plugins/component-testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Able to find CT project, ${!!ctProjectConfig}.`);
assets: buildAssets,
outputPath: buildOuputPath,
outputFileName: 'main.js',
compiler: 'swc',
compiler: options?.compiler || 'swc',
tsConfig: join(
ctExecutorContext.root,
ctProjectConfig.root,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/plugins/component-testing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export function nxComponentTestingPreset(
const { buildBaseWebpackConfig } = require('./webpack-fallback');
webpackConfig = buildBaseWebpackConfig({
tsConfigPath: findTsConfig(normalizedProjectRootPath),
compiler: 'babel',
compiler: options?.compiler || 'babel',
});
}

Expand Down

0 comments on commit c1a0442

Please sign in to comment.