File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -291,11 +291,18 @@ export class NativeScriptDebugAdapter extends ChromeDebugAdapter {
291291
292292 private getWebpackConfig ( webRoot : string , platform : string ) {
293293 const webpackConfigFile = join ( webRoot , 'webpack.config.js' ) ;
294+ const pathProcess = process . cwd ( ) ;
295+
294296 if ( existsSync ( webpackConfigFile ) ) {
295297 try {
298+ // Apply the project path so that ns/webpack can resolve the path
299+ process . chdir ( webRoot ) ;
296300 const webpackConfig = require ( webpackConfigFile ) ;
297- return webpackConfig ( { [ `${ platform } ` ] : platform } ) ;
301+ const webpackConfigResult = webpackConfig ( { [ `${ platform } ` ] : platform } ) ;
302+ process . chdir ( pathProcess ) ;
303+ return webpackConfigResult ;
298304 } catch ( err ) {
305+ process . chdir ( pathProcess ) ;
299306 logger . warn ( `Error when trying to require webpack.config.js file from path '${ webpackConfigFile } '. Error is: ${ err } ` ) ;
300307 }
301308 }
You can’t perform that action at this time.
0 commit comments