Skip to content

Commit

Permalink
feat(testing): set transpileOnly=true ...
Browse files Browse the repository at this point in the history
... and use the ForkTsCheckerWebpackPlugin
for the cypress test execution.

Closes nrwl#1871
  • Loading branch information
skydever committed Sep 23, 2019
1 parent fa05f11 commit d71d621
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@angular-devkit/architect": "0.803.3",
"@angular-devkit/core": "8.3.3",
"@cypress/webpack-preprocessor": "~4.1.0",
"fork-ts-checker-webpack-plugin": "^0.4.9",
"tree-kill": "1.2.1",
"ts-loader": "5.3.1",
"tsconfig-paths-webpack-plugin": "3.2.0",
Expand Down
11 changes: 10 additions & 1 deletion packages/cypress/src/plugins/preprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import * as wp from '@cypress/webpack-preprocessor';
import { TsconfigPathsPlugin } from 'tsconfig-paths-webpack-plugin';
import * as nodeExternals from 'webpack-node-externals';

import ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

export function preprocessTypescript(config: any) {
if (!config.env.tsConfig) {
throw new Error(
Expand Down Expand Up @@ -35,11 +37,18 @@ export function getWebpackConfig(config: any) {
options: {
configFile: config.env.tsConfig,
// https://github.com/TypeStrong/ts-loader/pull/685
experimentalWatchApi: true
experimentalWatchApi: true,
// https://github.com/cypress-io/cypress/issues/2316
transpileOnly: true
}
}
]
},
plugins: [
new ForkTsCheckerWebpackPlugin({
tsconfig: config.env.tsConfig
})
],
externals: [nodeExternals()]
};
}

0 comments on commit d71d621

Please sign in to comment.