diff --git a/e2e/cypress/plugins/typescriptPreprocessor.js b/e2e/cypress/plugins/typescriptPreprocessor.js index be506578188..27765380994 100644 --- a/e2e/cypress/plugins/typescriptPreprocessor.js +++ b/e2e/cypress/plugins/typescriptPreprocessor.js @@ -1,32 +1,18 @@ const wp = require('@cypress/webpack-preprocessor'); -const { resolve } = require('path'); - -const anyNodeModules = /node_modules/; -const packageRoot = resolve(`${__dirname}/../../`); -const packageModules = `${packageRoot}/node_modules`; const webpackOptions = { module: { rules: [ { - include: (modulePath) => { - if (!anyNodeModules.test(modulePath)) { - // Is a file within the project - return true; - } else { - // Is a file within this package - return modulePath.startsWith(packageRoot) && !modulePath.startsWith(packageModules); - } - }, test: /\.ts$/, - use: [ - { - loader: 'ts-loader', - options: { - transpileOnly: true, - }, + exclude: /node_modules/, + use: { + loader: 'esbuild-loader', + options: { + target: 'es2020', + format: undefined, }, - ], + }, }, ], }, diff --git a/package.json b/package.json index 85b24dc2776..4ac4f1d7425 100644 --- a/package.json +++ b/package.json @@ -226,7 +226,6 @@ "testing-library-selector": "0.3.1", "tracelib": "1.0.1", "ts-jest": "29.1.1", - "ts-loader": "9.3.1", "ts-node": "10.9.1", "typescript": "4.8.4", "wait-on": "7.0.1", diff --git a/plugins-bundled/internal/input-datasource/package.json b/plugins-bundled/internal/input-datasource/package.json index 95c189508b0..8229547e4dd 100644 --- a/plugins-bundled/internal/input-datasource/package.json +++ b/plugins-bundled/internal/input-datasource/package.json @@ -22,8 +22,8 @@ "fork-ts-checker-webpack-plugin": "8.0.0", "jest": "29.3.1", "jest-environment-jsdom": "29.3.1", + "swc-loader": "0.2.3", "ts-jest": "29.0.5", - "ts-loader": "9.3.1", "ts-node": "10.9.1", "webpack": "5.76.0" }, diff --git a/plugins-bundled/internal/input-datasource/webpack.config.ts b/plugins-bundled/internal/input-datasource/webpack.config.ts index 1620a0b9d4d..f90c0a0c539 100644 --- a/plugins-bundled/internal/input-datasource/webpack.config.ts +++ b/plugins-bundled/internal/input-datasource/webpack.config.ts @@ -70,7 +70,20 @@ const config = async (env: Record): Promise => ({ exclude: /(node_modules)/, test: /\.[tj]sx?$/, use: { - loader: 'ts-loader', + loader: 'swc-loader', + options: { + jsc: { + baseUrl: '.', + target: 'es2015', + loose: false, + parser: { + syntax: 'typescript', + tsx: true, + decorators: false, + dynamicImport: true, + }, + }, + }, }, }, { diff --git a/yarn.lock b/yarn.lock index ea48e80d05f..e89461185a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2881,8 +2881,8 @@ __metadata: jest: 29.3.1 jest-environment-jsdom: 29.3.1 react: 18.2.0 + swc-loader: 0.2.3 ts-jest: 29.0.5 - ts-loader: 9.3.1 ts-node: 10.9.1 tslib: 2.5.0 webpack: 5.76.0 @@ -15240,7 +15240,7 @@ __metadata: languageName: node linkType: hard -"enhanced-resolve@npm:^5.0.0, enhanced-resolve@npm:^5.10.0, enhanced-resolve@npm:^5.15.0": +"enhanced-resolve@npm:^5.10.0, enhanced-resolve@npm:^5.15.0": version: 5.15.0 resolution: "enhanced-resolve@npm:5.15.0" dependencies: @@ -18084,7 +18084,6 @@ __metadata: tinycolor2: 1.6.0 tracelib: 1.0.1 ts-jest: 29.1.1 - ts-loader: 9.3.1 ts-node: 10.9.1 tslib: 2.6.0 tween-functions: ^1.2.0 @@ -29048,21 +29047,6 @@ __metadata: languageName: node linkType: hard -"ts-loader@npm:9.3.1": - version: 9.3.1 - resolution: "ts-loader@npm:9.3.1" - dependencies: - chalk: ^4.1.0 - enhanced-resolve: ^5.0.0 - micromatch: ^4.0.0 - semver: ^7.3.4 - peerDependencies: - typescript: "*" - webpack: ^5.0.0 - checksum: 462a8ac315017cf4961dafd2be29d5abe7c3af63c4515e325269f79b9d0212b35c59184d7fd01fc378749c88454752e1599301d2190eb6844ea5fe332de5f695 - languageName: node - linkType: hard - "ts-node@npm:10.9.1, ts-node@npm:^10.2.1": version: 10.9.1 resolution: "ts-node@npm:10.9.1"