File tree 1 file changed +8
-1
lines changed
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 {
291
291
292
292
private getWebpackConfig ( webRoot : string , platform : string ) {
293
293
const webpackConfigFile = join ( webRoot , 'webpack.config.js' ) ;
294
+ const pathProcess = process . cwd ( ) ;
295
+
294
296
if ( existsSync ( webpackConfigFile ) ) {
295
297
try {
298
+ // Apply the project path so that ns/webpack can resolve the path
299
+ process . chdir ( webRoot ) ;
296
300
const webpackConfig = require ( webpackConfigFile ) ;
297
- return webpackConfig ( { [ `${ platform } ` ] : platform } ) ;
301
+ const webpackConfigResult = webpackConfig ( { [ `${ platform } ` ] : platform } ) ;
302
+ process . chdir ( pathProcess ) ;
303
+ return webpackConfigResult ;
298
304
} catch ( err ) {
305
+ process . chdir ( pathProcess ) ;
299
306
logger . warn ( `Error when trying to require webpack.config.js file from path '${ webpackConfigFile } '. Error is: ${ err } ` ) ;
300
307
}
301
308
}
You can’t perform that action at this time.
0 commit comments