File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @patternfly/pfe-tools " : patch
3+ ---
4+
5+ Correctly resolve all node_modules sources in dev server
Original file line number Diff line number Diff line change @@ -108,11 +108,12 @@ export function resolveLocalFilesFromTypeScriptSources(options: PfeDevServerConf
108108 return {
109109 name : 'resolve-local-monorepo-packages-from-ts-sources' ,
110110 async transformImport ( { source, context } ) {
111- // already resolved, but had `.js` appended, probably by export map
111+ const isNodeModule = source . match ( / n o d e _ m o d u l e s / ) || context . path . match ( / n o d e _ m o d u l e s / ) ;
112112 if ( source . endsWith ( '.ts.js' ) ) {
113- return source . replace ( '.ts.js' , '.ts' ) ;
114- // don't try to resolve node_modules, they're already resolved
115- } else if ( source . match ( / n o d e _ m o d u l e s / ) || context . path . match ( / n o d e _ m o d u l e s / ) ) {
113+ // already resolved, but had `.js` appended, probably by export map
114+ return source . replace ( '.ts.js' , isNodeModule ? '.js' : '.ts' ) ;
115+ } else if ( isNodeModule ) {
116+ // don't try to resolve node_modules, they're already resolved
116117 return ;
117118 } else {
118119 const resolved = tryToResolve ( source , context ) ;
You can’t perform that action at this time.
0 commit comments