@@ -4,7 +4,7 @@ import path from 'node:path';
44import util from 'node:util' ;
55import * as unionfs from 'unionfs' ;
66import * as memfs from 'memfs' ;
7- import type { Configuration } from 'webpack' ;
7+ import type { Configuration , javascript } from 'webpack' ;
88import { webpack , NormalModuleReplacementPlugin } from 'webpack' ;
99import type { Logger } from '../logger' ;
1010import { DefaultLogger , hasColorSupport } from '../logger' ;
@@ -241,15 +241,16 @@ exports.importInterceptors = function importInterceptors() {
241241 {
242242 apply : ( compiler ) => {
243243 compiler . hooks . normalModuleFactory . tap ( 'WorkflowCodeBundler' , ( normalModuleFactory ) => {
244- for ( const moduleType of [ 'javascript/auto' , 'javascript/dynamic' , 'javascript/esm' ] ) {
245- normalModuleFactory . hooks . parser . for ( moduleType ) . tap ( 'WorkflowCodeBundler' , ( parser ) => {
246- const javascriptParser = parser as any ;
247- javascriptParser . hooks . expression . for ( 'process' ) . tap ( 'WorkflowCodeBundler' , ( ) => {
248- if ( ! javascriptParser . isVariableDefined ( 'process' ) ) {
249- this . foundProblematicModules . add ( 'process' ) ;
250- }
244+ for ( const moduleType of [ 'javascript/auto' , 'javascript/dynamic' , 'javascript/esm' ] as const ) {
245+ normalModuleFactory . hooks . parser
246+ . for ( moduleType )
247+ . tap ( 'WorkflowCodeBundler' , ( javascriptParser : javascript . JavascriptParser ) => {
248+ javascriptParser . hooks . expression . for ( 'process' ) . tap ( 'WorkflowCodeBundler' , ( ) => {
249+ if ( ! javascriptParser . isVariableDefined ( 'process' ) ) {
250+ this . foundProblematicModules . add ( 'process' ) ;
251+ }
252+ } ) ;
251253 } ) ;
252- } ) ;
253254 }
254255 } ) ;
255256 } ,
0 commit comments