File tree Expand file tree Collapse file tree 4 files changed +25
-4
lines changed Expand file tree Collapse file tree 4 files changed +25
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @module-federation/third-party-dts-extractor ' : patch
3
+ ' @module-federation/dts-plugin ' : patch
4
+ ---
5
+
6
+ fix: do not collect node internal utils
Original file line number Diff line number Diff line change 1
- import { rmSync } from 'fs' ;
2
1
import path from 'path' ;
2
+ import { rmSync } from 'fs' ;
3
3
4
- const TEMP_TS_CONFIG_DIR = path . resolve ( __dirname , 'node_modules/.federation' ) ;
4
+ const TEMP_TS_CONFIG_DIR = path . resolve (
5
+ __dirname ,
6
+ '../node_modules/.federation' ,
7
+ ) ;
5
8
try {
6
9
rmSync ( TEMP_TS_CONFIG_DIR , { recursive : true } ) ;
7
10
} catch ( err ) {
8
11
// noop
9
12
}
13
+ const TEMP_DIST = path . resolve ( __dirname , '../dist-test' ) ;
14
+ try {
15
+ rmSync ( TEMP_DIST , { recursive : true } ) ;
16
+ } catch ( err ) {
17
+ // noop
18
+ }
Original file line number Diff line number Diff line change 1
1
/// <reference types="vitest" />
2
2
import { defineConfig } from 'vite' ;
3
- import path from 'path ';
3
+ import './tests/setup ';
4
4
5
5
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin' ;
6
6
@@ -20,6 +20,5 @@ export default defineConfig({
20
20
] ,
21
21
reporters : [ 'default' ] ,
22
22
testTimeout : 60000 ,
23
- setupFiles : [ path . resolve ( __dirname , './tests/setup.ts' ) ] ,
24
23
} ,
25
24
} ) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ import { getTypedName } from './utils';
6
6
7
7
const ignoredPkgs = [ 'typescript' ] ;
8
8
9
+ // require.resolve('path')==='path'
10
+ const isNodeUtils = ( pkgJsonPath : string , importPath : string ) => {
11
+ return pkgJsonPath === importPath ;
12
+ } ;
9
13
class ThirdPartyExtractor {
10
14
pkgs : Record < string , string > ;
11
15
pattern : RegExp ;
@@ -41,6 +45,9 @@ class ThirdPartyExtractor {
41
45
const pkgJsonPath = findPkg . sync (
42
46
require . resolve ( importPath , { paths : [ this . context ] } ) ,
43
47
) as string ;
48
+ if ( isNodeUtils ( pkgJsonPath , importPath ) ) {
49
+ return ;
50
+ }
44
51
const dir = path . dirname ( pkgJsonPath ) ;
45
52
const pkg = JSON . parse ( fs . readFileSync ( pkgJsonPath , 'utf-8' ) ) as Record <
46
53
string ,
You can’t perform that action at this time.
0 commit comments