Skip to content

Commit be91d1f

Browse files
authored
fix(core): stop inlining tsconfig-paths-webpack-plugin and use version with fix (#8357)
1 parent 78c9f15 commit be91d1f

File tree

18 files changed

+19
-1068
lines changed

18 files changed

+19
-1068
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
"ts-loader": "^9.2.6",
236236
"ts-node": "9.1.1",
237237
"tsconfig-paths": "^3.9.0",
238-
"tsconfig-paths-webpack-plugin": "3.4.1",
238+
"tsconfig-paths-webpack-plugin": "3.5.2",
239239
"tslib": "^2.3.0",
240240
"tslint": "6.1.3",
241241
"tslint-to-eslint-config": "^2.4.0",

packages/cypress/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"enhanced-resolve": "^5.8.3",
4242
"ts-loader": "^9.2.6",
4343
"tsconfig-paths": "^3.9.0",
44-
"tsconfig-paths-webpack-plugin": "3.4.1",
44+
"tsconfig-paths-webpack-plugin": "3.5.2",
4545
"webpack-node-externals": "^3.0.0",
4646
"fork-ts-checker-webpack-plugin": "6.2.10",
4747
"rxjs": "^6.5.4",

packages/next/src/utils/config.spec.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@ import { createWebpackConfig, prepareConfig } from './config';
22
import { NextBuildBuilderOptions } from '@nrwl/next';
33
import { dirname } from 'path';
44
import { importConstants } from './require-shim';
5-
// Inlining tsconfig-paths-webpack-plugin with a patch
6-
// See: https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/85
7-
// TODO(jack): Remove once the patch lands in original package
8-
import { TsconfigPathsPlugin } from '@nrwl/web/src/utils/webpack/plugins/tsconfig-paths/tsconfig-paths.plugin';
5+
import { TsconfigPathsPlugin } from 'tsconfig-paths-webpack-plugin';
96

107
const { PHASE_PRODUCTION_BUILD } = importConstants();
118

12-
jest.mock(
13-
'@nrwl/web/src/utils/webpack/plugins/tsconfig-paths/tsconfig-paths.plugin'
14-
);
9+
jest.mock('tsconfig-paths-webpack-plugin');
1510
jest.mock('next/dist/server/config', () => ({
1611
__esModule: true,
1712
default: () => ({

packages/next/src/utils/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type {
1010
PHASE_PRODUCTION_SERVER,
1111
} from 'next/dist/shared/lib/constants';
1212
import { join, resolve } from 'path';
13-
import { TsconfigPathsPlugin } from '@nrwl/web/src/utils/webpack/plugins/tsconfig-paths/tsconfig-paths.plugin';
13+
import { TsconfigPathsPlugin } from 'tsconfig-paths-webpack-plugin';
1414
import { Configuration } from 'webpack';
1515
import {
1616
FileReplacement,
@@ -71,7 +71,7 @@ export function createWebpackConfig(
7171
configFile: tsConfigPath,
7272
extensions,
7373
mainFields,
74-
}),
74+
}) as never, // TODO: Remove never type when 'tsconfig-paths-webpack-plugin' types fixed
7575
];
7676

7777
fileReplacements

packages/node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"tree-kill": "1.2.2",
4747
"ts-loader": "^9.2.6",
4848
"tsconfig-paths": "^3.9.0",
49-
"tsconfig-paths-webpack-plugin": "3.4.1",
49+
"tsconfig-paths-webpack-plugin": "3.5.2",
5050
"tslib": "^2.3.0",
5151
"webpack": "^5.58.1",
5252
"webpack-merge": "^5.8.0",

packages/node/src/executors/build/build.impl.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { ProjectGraph } from '@nrwl/workspace/src/core/project-graph';
55
import buildExecutor from './build.impl';
66
import { BuildNodeBuilderOptions } from '../../utils/types';
77

8-
jest.mock('../../utils/webpack/plugins/tsconfig-paths/tsconfig-paths.plugin');
8+
jest.mock('tsconfig-paths-webpack-plugin');
99
jest.mock('../../utils/run-webpack', () => ({
1010
runWebpack: jest.fn(),
1111
}));

packages/node/src/utils/config.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ import { BuildBuilderOptions } from './types';
88
import { loadTsPlugins } from './load-ts-plugins';
99
import CopyWebpackPlugin = require('copy-webpack-plugin');
1010
import ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
11-
12-
// Inlining tsconfig-paths-webpack-plugin with a patch
13-
// See: https://github.com/dividab/tsconfig-paths-webpack-plugin/pull/85
14-
// TODO(jack): Remove once the patch lands in original package
15-
import TsConfigPathsPlugin from './webpack/plugins/tsconfig-paths/tsconfig-paths.plugin';
11+
import { TsconfigPathsPlugin } from 'tsconfig-paths-webpack-plugin';
1612

1713
export const OUT_FILENAME_TEMPLATE = '[name].js';
1814

@@ -85,11 +81,11 @@ export function getBaseWebpackPartial(
8581
extensions,
8682
alias: getAliases(options),
8783
plugins: [
88-
new TsConfigPathsPlugin({
84+
new TsconfigPathsPlugin({
8985
configFile: options.tsConfig,
9086
extensions,
9187
mainFields,
92-
}),
88+
}) as never, // TODO: Remove never type when 'tsconfig-paths-webpack-plugin' types fixed
9389
],
9490
mainFields,
9591
},

packages/node/src/utils/node.config.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { join } from 'path';
22
import { getNodeWebpackConfig } from './node.config';
3-
import TsConfigPathsPlugin from './webpack/plugins/tsconfig-paths/tsconfig-paths.plugin';
3+
import { TsconfigPathsPlugin } from 'tsconfig-paths-webpack-plugin';
44
import { BuildNodeBuilderOptions } from './types';
55

6-
jest.mock('./webpack/plugins/tsconfig-paths/tsconfig-paths.plugin');
6+
jest.mock('tsconfig-paths-webpack-plugin');
77
jest.mock('@nrwl/tao/src/utils/app-root', () => ({
88
get appRootPath() {
99
return join(__dirname, '../../../..');
@@ -21,7 +21,7 @@ describe('getNodePartial', () => {
2121
fileReplacements: [],
2222
statsJson: false,
2323
};
24-
(<any>TsConfigPathsPlugin).mockImplementation(
24+
(<any>TsconfigPathsPlugin).mockImplementation(
2525
function MockPathsPlugin() {}
2626
);
2727
});

packages/node/src/utils/webpack/plugins/tsconfig-paths/tsconfig-paths.logger.ts

Lines changed: 0 additions & 83 deletions
This file was deleted.

packages/node/src/utils/webpack/plugins/tsconfig-paths/tsconfig-paths.options.ts

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)