Skip to content

Commit

Permalink
chore: use TsconfigPathsPlugin in cypress test config (#29327)
Browse files Browse the repository at this point in the history
Cypress test config previously did not use TsConfigPathsPlugin so it
relied on code being built in CI.

However there is an edge case encountered in #29313. Lage will run the
cypress tests of depednencies which *_can depend on depedencies not in
the package.json tree_* 💣💣

```
- react-message-bar-preview
  - react-button
    - react-tabster
      - react-provider (not in package.json, but used in cypress test)
```
  • Loading branch information
ling1726 authored Sep 28, 2023
1 parent 22f66ce commit e7c0c14
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/cypress/src/base.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as path from 'path';

import { defineConfig } from 'cypress';
import { TsconfigPathsPlugin } from 'tsconfig-paths-webpack-plugin';
import type { Configuration } from 'webpack';

/**
Expand Down Expand Up @@ -32,6 +33,14 @@ const cypressWebpackConfig = (): Configuration => {
});
}

baseWebpackConfig.resolve ??= {};
baseWebpackConfig.resolve.plugins ??= [];
baseWebpackConfig.resolve.plugins.push(
new TsconfigPathsPlugin({
configFile: path.resolve(__dirname, '../../../tsconfig.base.json'),
}),
);

return baseWebpackConfig;
};

Expand Down

0 comments on commit e7c0c14

Please sign in to comment.